From 5a90cfe600073fbae6d097080ee88fd41cdcbeb7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Sep 2014 20:45:24 +0300 Subject: Move processItemDropped from ea namespace into eathena and tmwa. --- src/net/tmwa/itemhandler.cpp | 20 ++++++++++++++++++++ src/net/tmwa/itemhandler.h | 3 +++ 2 files changed, 23 insertions(+) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/itemhandler.cpp b/src/net/tmwa/itemhandler.cpp index 3b41d5bbc..95d1d0971 100644 --- a/src/net/tmwa/itemhandler.cpp +++ b/src/net/tmwa/itemhandler.cpp @@ -22,6 +22,8 @@ #include "net/tmwa/itemhandler.h" +#include "actormanager.h" + #include "net/tmwa/protocol.h" #include "debug.h" @@ -66,4 +68,22 @@ void ItemHandler::handleMessage(Net::MessageIn &msg) BLOCK_END("ItemHandler::handleMessage") } +void ItemHandler::processItemDropped(Net::MessageIn &msg) +{ + const int id = msg.readInt32(); + const int itemId = msg.readInt16(); + const uint8_t identify = msg.readUInt8(); // identify flag + const int x = msg.readInt16(); + const int y = msg.readInt16(); + const int subX = static_cast(msg.readInt8()); + const int subY = static_cast(msg.readInt8()); + const int amount = msg.readInt16(); + + if (actorManager) + { + actorManager->createItem(id, itemId, + x, y, amount, identify, subX, subY); + } +} + } // namespace TmwAthena diff --git a/src/net/tmwa/itemhandler.h b/src/net/tmwa/itemhandler.h index 5203da929..8caeda785 100644 --- a/src/net/tmwa/itemhandler.h +++ b/src/net/tmwa/itemhandler.h @@ -38,6 +38,9 @@ class ItemHandler final : public MessageHandler, public Ea::ItemHandler A_DELETE_COPY(ItemHandler) void handleMessage(Net::MessageIn &msg) override final; + + protected: + static void processItemDropped(Net::MessageIn &msg); }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2