summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-02-09 03:18:35 +0100
committerBertram <bertram@cegetel.net>2010-02-09 03:20:48 +0100
commitb7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd (patch)
tree2d110cf418fab5d733c5172a52aaaffa74c2d693 /src/being.cpp
parent6a6b36fa2d19a6ea9d39b975354709e7ad82281d (diff)
downloadmana-b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd.tar.gz
mana-b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd.tar.bz2
mana-b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd.tar.xz
mana-b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd.zip
Got successfully rid of tile width/height fallback values as asked by Jaxad.
But I added some logs when speed and other actions where refused due to game/map uninitialized. This could help.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/being.cpp b/src/being.cpp
index d5ee4a30..4b972e3d 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -799,7 +799,7 @@ int Being::getOffset(char pos, char neg) const
if (mAction != WALK || !(mDirection & (pos | neg)))
return 0;
- int offset;
+ int offset = 0;
if (mMap)
{
@@ -809,14 +809,6 @@ int Being::getOffset(char pos, char neg) const
(int)((get_elapsed_time(mWalkTime)
* mMap->getTileHeight()) / mWalkSpeed.y);
}
- else
- {
- 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
offset -= 32;