diff options
author | Bertram <bertram@cegetel.net> | 2010-02-09 03:18:35 +0100 |
---|---|---|
committer | Bertram <bertram@cegetel.net> | 2010-02-09 03:20:48 +0100 |
commit | b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd (patch) | |
tree | 2d110cf418fab5d733c5172a52aaaffa74c2d693 /src/being.cpp | |
parent | 6a6b36fa2d19a6ea9d39b975354709e7ad82281d (diff) | |
download | mana-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.cpp | 10 |
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; |