summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/being/being.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 5b1e49a8c..2e7f6d67b 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -1521,19 +1521,27 @@ void Being::logic()
}
}
- const int xOffset = getXOffset();
- const int yOffset = getYOffset();
- int offset = xOffset;
- if (!offset)
- offset = yOffset;
-
- 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),
- static_cast<float>(mY * 32 + 32 + yOffset2));
+ if (mAction == MOVE)
+ {
+ const int xOffset = getXOffset();
+ const int yOffset = getYOffset();
+ int offset = xOffset;
+ if (!offset)
+ offset = yOffset;
+
+ 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),
+ static_cast<float>(mY * 32 + 32 + yOffset2));
+ }
+ else
+ {
+ setPosition(static_cast<float>(mX * 32 + 16),
+ static_cast<float>(mY * 32 + 32));
+ }
}
if (mEmotionSprite)