summaryrefslogtreecommitdiff
path: root/src/net/itemhandler.cpp
diff options
context:
space:
mode:
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;
}
}