summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 33f38255..d5ee4a30 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -811,8 +811,11 @@ int Being::getOffset(char pos, char neg) const
}
else
{
- offset = (int)((get_elapsed_time(mWalkTime)
- * DEFAULT_TILE_SIDE_LENGTH) / mWalkSpeed.x);
+ offset = (pos == LEFT && neg == RIGHT) ?
+ (int)((get_elapsed_time(mWalkTime)
+ * DEFAULT_TILE_WIDTH) / mWalkSpeed.x) :
+ (int)((get_elapsed_time(mWalkTime)
+ * DEFAULT_TILE_HEIGHT) / mWalkSpeed.y);
}
// We calculate the offset _from_ the _target_ location