diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-01-03 23:29:12 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-01-03 23:29:12 +0000 |
commit | 9fed9560dd53d5d588b39e01891e3cc9d55c2252 (patch) | |
tree | 9730c24910c177d4a8f46e68da63e1745644b6d9 | |
parent | a03aa92149bbabd6aa23c88ee337d04cefbf50c0 (diff) | |
download | manaserv-9fed9560dd53d5d588b39e01891e3cc9d55c2252.tar.gz manaserv-9fed9560dd53d5d588b39e01891e3cc9d55c2252.tar.bz2 manaserv-9fed9560dd53d5d588b39e01891e3cc9d55c2252.tar.xz manaserv-9fed9560dd53d5d588b39e01891e3cc9d55c2252.zip |
Forgot about removing items from the map.
-rw-r--r-- | src/game-server/state.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp index 2972bd06..3cfb0e76 100644 --- a/src/game-server/state.cpp +++ b/src/game-server/state.cpp @@ -360,6 +360,23 @@ void State::remove(Thing *ptr) } } } + else if (ptr->getType() == OBJECT_ITEM) + { + Item *obj = static_cast< Item * >(ptr); + Point pos = obj->getPosition(); + MessageOut msg(GPMSG_ITEMS); + msg.writeShort(0); + msg.writeShort(pos.x); + msg.writeShort(pos.y); + + for (PlayerIterator p(map->getAroundObjectIterator(obj, AROUND_AREA)); p; ++p) + { + if (pos.inRangeOf((*p)->getPosition(), AROUND_AREA)) + { + gameHandler->sendTo(*p, msg); + } + } + } map->remove(ptr); } |