summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-09-22 01:03:44 +0200
committerBertram <bertram@cegetel.net>2009-09-22 01:03:44 +0200
commit129cdf162b2727c8854e0c6b79d2e79906e5dcfb (patch)
tree241fc216c7ff3f1081767cf54552796304a3eb70 /src/localplayer.cpp
parentbf6e1331941daecb3c3ff12c3b86457899042953 (diff)
downloadmana-129cdf162b2727c8854e0c6b79d2e79906e5dcfb.tar.gz
mana-129cdf162b2727c8854e0c6b79d2e79906e5dcfb.tar.bz2
mana-129cdf162b2727c8854e0c6b79d2e79906e5dcfb.tar.xz
mana-129cdf162b2727c8854e0c6b79d2e79906e5dcfb.zip
An attempt to fix the mouse ignoring collisions in TMWserv.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 7cd6b889..635f7d04 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -500,6 +500,11 @@ void LocalPlayer::setDestination(Uint16 x, Uint16 y)
#endif
{
#ifdef TMWSERV_SUPPORT
+ // Check the walkability of the destination
+ // If the destination is a wall, don't go there!
+ if (!mMap->getWalk(x / 32, y / 32))
+ return;
+
// Fix coordinates so that the player does not seem to dig into walls.
const int tx = x / 32;
const int ty = y / 32;