diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-03-29 01:50:58 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-03-29 01:50:58 +0200 |
commit | f90aa61947641f3db809e047f80fc7b8c865cb94 (patch) | |
tree | 0651f81765437772d0f20ee44acb75b76bd64c15 /src/flooritem.cpp | |
parent | 15c69030f987bd7d67fdbaf2158b2c3ae430143f (diff) | |
download | mana-f90aa61947641f3db809e047f80fc7b8c865cb94.tar.gz mana-f90aa61947641f3db809e047f80fc7b8c865cb94.tar.bz2 mana-f90aa61947641f3db809e047f80fc7b8c865cb94.tar.xz mana-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/flooritem.cpp')
-rw-r--r-- | src/flooritem.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/flooritem.cpp b/src/flooritem.cpp index 8805ba88..07903a79 100644 --- a/src/flooritem.cpp +++ b/src/flooritem.cpp @@ -22,23 +22,27 @@ #include "flooritem.h" #include "net/net.h" +#include "net/playerhandler.h" #include "resources/itemdb.h" #include "resources/iteminfo.h" FloorItem::FloorItem(int id, int itemId, - int x, - int y, + const Vector &position, Map *map): ActorSprite(id), mItemId(itemId), - mX(x), - mY(y) + mX(0), mY(0) { - setMap(map); + mPos = position; - mPos = map->getTileCenter(x, y); + setMap(map); + if (map) + { + mX = (int)position.x / map->getTileWidth(); + mY = (int)position.y / map->getTileHeight(); + } setupSpriteDisplay(itemDb->get(itemId).getDisplay()); } |