diff options
author | Dennis Friis <peavey@placid.dk> | 2008-10-30 20:13:26 +0000 |
---|---|---|
committer | Dennis Friis <peavey@placid.dk> | 2008-10-30 20:13:26 +0000 |
commit | 6d928722369bc1db7f17d3fb0d0cb69ce304d39b (patch) | |
tree | 1a85ace05ff7188603f64b852ae2454f595c44fb /src/localplayer.cpp | |
parent | 9e25bb7db1aae37538327348a40de1361b63ac85 (diff) | |
download | mana-6d928722369bc1db7f17d3fb0d0cb69ce304d39b.tar.gz mana-6d928722369bc1db7f17d3fb0d0cb69ce304d39b.tar.bz2 mana-6d928722369bc1db7f17d3fb0d0cb69ce304d39b.tar.xz mana-6d928722369bc1db7f17d3fb0d0cb69ce304d39b.zip |
Minor fixes to movement and hit effects. Patch by Kage_Jittai.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index b6f478a0..fce9506a 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -47,7 +47,7 @@ #include "utils/tostring.h" #include "utils/gettext.h" -const short walkingKeyboardDelay = 500; +const short walkingKeyboardDelay = 100; LocalPlayer *player_node = NULL; @@ -262,6 +262,7 @@ void LocalPlayer::walk(unsigned char dir) if (dir & RIGHT) dx += 32; + // Prevent skipping corners over colliding tiles if (dx && !mMap->getWalk(((int) pos.x + dx) / 32, (int) pos.y / 32, getWalkMask())) @@ -274,10 +275,10 @@ void LocalPlayer::walk(unsigned char dir) if (dx && dy && !mMap->getWalk((pos.x + dx) / 32, (pos.y + dy) / 32, getWalkMask())) dx = 16 - (int) pos.x % 32; - + // Checks our path up to 5 tiles, if a blocking tile is found // We go to the last good tile, and break out of the loop - for (dScaler = 1; dScaler <= 5; dScaler++) + for (dScaler = 1; dScaler <= 10; dScaler++) { if ( (dx || dy) && !mMap->getWalk( ((int) pos.x + (dx * dScaler)) / 32, @@ -319,7 +320,6 @@ void LocalPlayer::setDestination(Uint16 x, Uint16 y) x = tx * 32 + fx; y = ty * 32 + fy; - // Only send a new message to the server when destination changes if (x != mDestX || y != mDestY) { |