diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-06 02:56:48 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-06 02:56:48 +0000 |
commit | e2c61ef8ec4f8685c0eafa2284c7485cec489021 (patch) | |
tree | cf2805221603b14e679205845fa0734702a8aae2 /src/net/itemhandler.cpp | |
parent | 2a7690e2687a43fdc0004684b7de97b2d84cb8b0 (diff) | |
download | mana-e2c61ef8ec4f8685c0eafa2284c7485cec489021.tar.gz mana-e2c61ef8ec4f8685c0eafa2284c7485cec489021.tar.bz2 mana-e2c61ef8ec4f8685c0eafa2284c7485cec489021.tar.xz mana-e2c61ef8ec4f8685c0eafa2284c7485cec489021.zip |
Added a FloorItemManager class.
Diffstat (limited to 'src/net/itemhandler.cpp')
-rw-r--r-- | src/net/itemhandler.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/net/itemhandler.cpp b/src/net/itemhandler.cpp index d2a938fd..567a5382 100644 --- a/src/net/itemhandler.cpp +++ b/src/net/itemhandler.cpp @@ -27,7 +27,7 @@ #include "protocol.h" #include "../engine.h" -#include "../floor_item.h" +#include "../flooritemmanager.h" ItemHandler::ItemHandler() { @@ -57,11 +57,14 @@ void ItemHandler::handleMessage(MessageIn *msg) y = msg->readInt16(); msg->skip(4); // amount,subX,subY / subX,subY,amount - add_floor_item(new FloorItem(id, itemId, x, y, engine->getCurrentMap())); + floorItemManager->create(id, itemId, x, y, engine->getCurrentMap()); break; case SMSG_ITEM_REMOVE: - remove_floor_item(msg->readInt32()); + FloorItem *item; + item = floorItemManager->findById(msg->readInt32()); + if (item) + floorItemManager->destroy(item); break; } } |