Index: common/Player.cpp
===================================================================
--- common/Player.cpp	(revision 227baaac00d4d0f4faf148d24d2f96055d08ab45)
+++ common/Player.cpp	(revision d2112105821e291eb9858c83e5d585459a73c33d)
@@ -95,23 +95,43 @@
       POSITION newPos;
 
+      //cout << "pos.x: " << pos.x << endl;
+      //cout << "pos.y: " << pos.y << endl;
+      //cout << "target.x: " << target.x << endl;
+      //cout << "target.y: " << target.y << endl;
+
       if (dist <= pixels) {
-         pos.x = target.x;
-         pos.y = target.y;
+         newPos.x = target.x;
+         newPos.y = target.y;
       }else {
          newPos.x = int(pos.x + cos(angle)*pixels);
          newPos.y = int(pos.y + sin(angle)*pixels);
+      }
 
-         switch(map->getElement(newPos.x/25, newPos.y/25)) {
-         case WorldMap::TERRAIN_NONE:
-         case WorldMap::TERRAIN_ROCK:
-            target.x = pos.x;
-            target.y = pos.y;
-            moveCanceled = true;
-            break;
-         }
+      //cout << "newPos.x: " << newPos.x << endl;
+      //cout << "newPos.y: " << newPos.y << endl;
+      //cout << "newPos.x/25: " << newPos.x/25 << endl;
+      //cout << "newPos.y/25: " << newPos.y/25 << endl;
+
+      switch(map->getElement(newPos.x/25, newPos.y/25)) {
+      case WorldMap::TERRAIN_NONE:
+      case WorldMap::TERRAIN_ROCK:
+         cout << "Encountered invalid terrain" << endl;
+         target.x = pos.x;
+         target.y = pos.y;
+         moveCanceled = true;
+         cout << "move canceled" << endl;
+         break;
+      default: // if there are no obstacles
+         pos.x = newPos.x;
+         pos.y = newPos.y;
+         break;
       }
    }
 
    timeLastUpdated = curTime;
+
+   if (moveCanceled)
+      cout << "moveCancled == true" << endl;
+
    return !moveCanceled;
 }
