From 6db83b4ee1c20162a9dd31428cbc36ce7405352d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 14 Feb 2016 02:29:16 +0300 Subject: Dont check and modify floor item position if server support haveExtendedDropsPosition. Also add for legacy servers support for maxFloorOffsetX/Y. --- src/being/flooritem.cpp | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'src/being') diff --git a/src/being/flooritem.cpp b/src/being/flooritem.cpp index c8f0687d6..a33a5b09b 100644 --- a/src/being/flooritem.cpp +++ b/src/being/flooritem.cpp @@ -80,20 +80,29 @@ void FloorItem::postInit(Map *const map, int subX, int subY) const ItemInfo &info = ItemDB::get(mItemId); if (map) { - const int max = info.getMaxFloorOffset(); - if (subX > max) - subX = max; - else if (subX < -max) - subX = -max; - if (subY > max) - subY = max; - else if (subY < -max) - subY = -max; + const int maxX = info.getMaxFloorOffsetX(); + const int maxY = info.getMaxFloorOffsetY(); + + if (!serverFeatures->haveExtendedDropsPosition()) + { + if (subX > maxX) + subX = maxX; + else if (subX < -maxX) + subX = -maxX; + if (subY > maxY) + subY = maxY; + else if (subY < -maxY) + subY = -maxY; + + subX -= 8; + subY -= 8; + } + mHeightPosDiff = map->getHeightOffset(mX, mY) * 16; mPos.x = static_cast(mX * map->getTileWidth() - + subX + mapTileSize / 2 - 8); + + subX + mapTileSize / 2); mPos.y = static_cast(mY * map->getTileHeight() - + subY + mapTileSize - 8 - mHeightPosDiff); + + subY + mapTileSize - mHeightPosDiff); mYDiff = 31 - mHeightPosDiff; } else -- cgit v1.2.3-60-g2f50