From bf6e1331941daecb3c3ff12c3b86457899042953 Mon Sep 17 00:00:00 2001 From: Bertram Date: Tue, 22 Sep 2009 00:24:33 +0200 Subject: Mostly fixed the mouse movement in TMWserv client. The only case left in mouse movement is that the client doesn't check for walkability of the destination point when you click on a unwalkable point. Let me explain this NASTY bug: The bug remained in the Being::SetDestination() function, when recalculating the path from tiles to pixels. The changeX and changeY variables went crazy when (endX - startX) gave a negative value. That why the given path became random, and the player went anywhere. This didn't happened to monsters, NPCs, and when walking using the keyboard because the patnodes system isn't used for movement up to 1 tile at a time. I removed some dead code (in viewpoint.cpp), made the keyboard navigation a little bit more bearable, and fixed this client bug. Now, I'll be up to finish fixing the movement system using mouse (What's remaining is a joke next to what I had to do to discover this...), and I'll look at a third time to the keyboard system which is a bit raw, just for now... Regards, P.S.: Kage, I'd like to get a three-cheese pizza! --- src/localplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/localplayer.cpp') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 9b8e4a4b..7cd6b889 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -418,9 +418,9 @@ void LocalPlayer::walk(unsigned char dir) int dScaler; // Distance to walk - // Checks our path up to 1 tiles, if a blocking tile is found + // Checks our path up to 2 tiles, if a blocking tile is found // We go to the last good tile, and break out of the loop - for (dScaler = 1; dScaler <= 32; dScaler++) + for (dScaler = 1; dScaler <= 32 * 2; dScaler++) { if ( (dx || dy) && !mMap->getWalk( ((int) pos.x + (dx * dScaler)) / 32, -- cgit v1.2.3-70-g09d2