summaryrefslogtreecommitdiff
path: root/src/net/tmwa/itemhandler.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-29 01:50:58 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-29 01:50:58 +0200
commitf90aa61947641f3db809e047f80fc7b8c865cb94 (patch)
tree0651f81765437772d0f20ee44acb75b76bd64c15 /src/net/tmwa/itemhandler.cpp
parent15c69030f987bd7d67fdbaf2158b2c3ae430143f (diff)
downloadmana-client-f90aa61947641f3db809e047f80fc7b8c865cb94.tar.gz
mana-client-f90aa61947641f3db809e047f80fc7b8c865cb94.tar.bz2
mana-client-f90aa61947641f3db809e047f80fc7b8c865cb94.tar.xz
mana-client-f90aa61947641f3db809e047f80fc7b8c865cb94.zip
Made the flooritems position set back in pixels.
The position is centered to the nearest tile center in tA.
Diffstat (limited to 'src/net/tmwa/itemhandler.cpp')
-rw-r--r--src/net/tmwa/itemhandler.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/net/tmwa/itemhandler.cpp b/src/net/tmwa/itemhandler.cpp
index a8e98860..e452ccf2 100644
--- a/src/net/tmwa/itemhandler.cpp
+++ b/src/net/tmwa/itemhandler.cpp
@@ -21,12 +21,14 @@
#include "net/tmwa/itemhandler.h"
-#include "actorspritemanager.h"
-
#include "net/messagein.h"
#include "net/tmwa/protocol.h"
+#include "actorspritemanager.h"
+#include "game.h"
+#include "map.h"
+
namespace TmwAthena {
ItemHandler::ItemHandler()
@@ -54,7 +56,13 @@ void ItemHandler::handleMessage(Net::MessageIn &msg)
int y = msg.readInt16();
msg.skip(4); // amount,subX,subY / subX,subY,amount
- actorSpriteManager->createItem(id, itemId, x, y);
+ Game *game = Game::instance();
+ if (!game)
+ break;
+
+ if (Map *map = game->getCurrentMap())
+ actorSpriteManager->createItem(id, itemId,
+ map->getTileCenter(x, y));
}
break;