diff options
author | Chuck Miller <shadowmil@gmail.com> | 2009-08-01 00:13:22 -0400 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2009-08-01 02:09:23 -0400 |
commit | ede286e65f1ccbf4ddfddba7be66467272440a13 (patch) | |
tree | 6c4bbe23e2e68a1bf1edc14beed4b064a8967d88 /src/localplayer.cpp | |
parent | 299f987469192b7c77b4b724875b481a8fa83ced (diff) | |
download | mana-ede286e65f1ccbf4ddfddba7be66467272440a13.tar.gz mana-ede286e65f1ccbf4ddfddba7be66467272440a13.tar.bz2 mana-ede286e65f1ccbf4ddfddba7be66467272440a13.tar.xz mana-ede286e65f1ccbf4ddfddba7be66467272440a13.zip |
Simplifies movement to only move to the current pos
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 4e9257ca..ff3267ad 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -375,16 +375,6 @@ void LocalPlayer::walk(unsigned char dir) } int dx = 0, dy = 0; -#ifdef TMWSERV_SUPPORT - if (dir & UP) - dy -= 32; - if (dir & DOWN) - dy += 32; - if (dir & LEFT) - dx -= 32; - if (dir & RIGHT) - dx += 32; -#else if (dir & UP) dy--; if (dir & DOWN) @@ -393,7 +383,6 @@ void LocalPlayer::walk(unsigned char dir) dx--; if (dir & RIGHT) dx++; -#endif // Prevent skipping corners over colliding tiles #ifdef TMWSERV_SUPPORT @@ -420,7 +409,7 @@ void LocalPlayer::walk(unsigned char dir) // Checks our path up to 1 tiles, if a blocking tile is found // We go to the last good tile, and break out of the loop - for (dScaler = 1; dScaler <= 1; dScaler++) + for (dScaler = 1; dScaler <= 32; dScaler++) { if ( (dx || dy) && !mMap->getWalk( ((int) pos.x + (dx * dScaler)) / 32, @@ -433,7 +422,8 @@ void LocalPlayer::walk(unsigned char dir) if (dScaler >= 0) { - setDestination((int) pos.x + (dx * dScaler), (int) pos.y + (dy * dScaler)); + effectManager->trigger(15, (int) pos.x + (dx * dScaler), (int) pos.y + (dy * dScaler)); + setDestination((int) pos.x + (dx * dScaler), (int) pos.y + (dy * dScaler)); } #else if (dx && dy && !mMap->getWalk(getTileX() + dx, getTileY() + dy, getWalkMask())) |