summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-17 21:09:37 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-17 21:12:04 +0300
commit17f2adad3ba9e6a5c64d2d923d9cbb190f234b6f (patch)
tree7599d726f1c640cb94c675f4e889b91a9fabe67b /src/being/being.cpp
parent01e2baa778318150bdd1829836cfff9e677cf72c (diff)
downloadManaVerse-17f2adad3ba9e6a5c64d2d923d9cbb190f234b6f.tar.gz
ManaVerse-17f2adad3ba9e6a5c64d2d923d9cbb190f234b6f.tar.bz2
ManaVerse-17f2adad3ba9e6a5c64d2d923d9cbb190f234b6f.tar.xz
ManaVerse-17f2adad3ba9e6a5c64d2d923d9cbb190f234b6f.zip
fix beings draw order with tile heights.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 00df60848..6d1307fab 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -147,7 +147,7 @@ Being::Being(const int id, const Type type, const uint16_t subtype,
mSpecialParticle(nullptr),
mX(0),
mY(0),
- mOffsetX(0),
+ mSortOffsetY(0),
mOffsetY(0),
mOldHeight(0),
mDamageTaken(0),
@@ -1527,8 +1527,9 @@ void Being::logic()
if (!offset)
offset = yOffset;
- const int yOffset2 = getYOffset() - (mOldHeight * 16)
- - (mOffsetY * 16) * (32 - abs(offset)) / 32;
+ mSortOffsetY = (mOldHeight * 16) + (mOffsetY * 16)
+ * (32 - abs(offset)) / 32;
+ const int yOffset2 = yOffset - mSortOffsetY;
// Update pixel coordinates
setPosition(static_cast<float>(mX * 32 + 16 + xOffset),