From 9fed9560dd53d5d588b39e01891e3cc9d55c2252 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Wed, 3 Jan 2007 23:29:12 +0000 Subject: Forgot about removing items from the map. --- src/game-server/state.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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); } -- cgit v1.2.3-70-g09d2