summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;