Index: common/Game.cpp
===================================================================
--- common/Game.cpp	(revision 012970027445bcb5af858de36c8fea1f47dc16fe)
+++ common/Game.cpp	(revision 402cf86857bd74889d5f5ddc68a7ee9ebd44c16a)
@@ -88,4 +88,28 @@
 }
 
+// returns true if the movement should be canceled
+bool Game::processPlayerMovement(Player* p, FLOAT_POSITION oldPos) {
+
+   // check if the move needs to be canceled
+   switch(this->worldMap->getElement(p->pos.x/25, p->pos.y/25))
+   {
+      case WorldMap::TERRAIN_NONE:
+      case WorldMap::TERRAIN_OCEAN:
+      case WorldMap::TERRAIN_ROCK:
+      {
+         p->pos = oldPos;
+         p->target.x = p->pos.x;
+         p->target.y = p->pos.y;
+         p->isChasing = false;
+         return true;
+         break;
+      }
+      default:
+         // if there are no obstacles, don't cancel movement
+         return false;
+         break;
+      }
+}
+
 void Game::setRedScore(int score) {
    this->redScore = score;
Index: common/Game.h
===================================================================
--- common/Game.h	(revision 012970027445bcb5af858de36c8fea1f47dc16fe)
+++ common/Game.h	(revision 402cf86857bd74889d5f5ddc68a7ee9ebd44c16a)
@@ -42,4 +42,6 @@
    bool removePlayer(unsigned int id);
    bool startPlayerMovement(unsigned int id, int x, int y);
+   bool processPlayerMovement(Player* p, FLOAT_POSITION oldPos);
+
    void setBlueScore(int score);
    void setRedScore(int score);
