summaryrefslogtreecommitdiff
path: root/src/net/itemhandler.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-06 02:56:48 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-06 02:56:48 +0000
commite2c61ef8ec4f8685c0eafa2284c7485cec489021 (patch)
treecf2805221603b14e679205845fa0734702a8aae2 /src/net/itemhandler.cpp
parent2a7690e2687a43fdc0004684b7de97b2d84cb8b0 (diff)
downloadmana-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.cpp9
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;
}
}