Index: code/branches/presentationHS13/src/modules/docking/Dock.cc
===================================================================
--- code/branches/presentationHS13/src/modules/docking/Dock.cc	(revision 9891)
+++ code/branches/presentationHS13/src/modules/docking/Dock.cc	(revision 9907)
@@ -69,4 +69,6 @@
         XMLPortObject(Dock, DockingAnimation, "animations", addAnimation, getAnimation, xmlelement, mode);
         XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
+        XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode);
+
     }
 
@@ -76,5 +78,53 @@
 
         XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
-    }
+
+        XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode);
+    }
+
+
+    bool Dock::undocking(bool bTriggered, BaseObject* trigger)
+    {
+
+    	PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
+    	PlayerInfo* player = NULL;
+
+    	// Check whether it is a player trigger and extract pawn from it
+    	if(pTrigger != NULL)
+    	{
+    	      if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
+    	      orxout(verbose, context::docking) << "Docking:execute PlayerTrigger was not triggered by a player.." << endl;
+    	      return false;
+    	      }
+    	      player = pTrigger->getTriggeringPlayer();
+    	}
+    	else
+    	{
+    	      orxout(verbose, context::docking) << "Docking::execute Not a player trigger, can't extract pawn from it.." << endl;
+    	      return false;
+    	}
+    	if(player == NULL)
+    	{
+    	      orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
+    	      return false;
+    	}
+
+ 	    if(bTriggered)
+    	{
+    	      // Add player to this Docks candidates
+    	      candidates_.insert(player);
+
+    	      // Show docking dialog
+    	      this->showUndockingDialogHelper(player);
+    	}
+    	else
+    	{
+    	      // Remove player from candidates list
+    	      candidates_.erase(player);
+    	}
+
+    	return true;
+    }
+
+
 
     bool Dock::execute(bool bTriggered, BaseObject* trigger)
@@ -119,4 +169,22 @@
         return true;
     }
+
+
+    void Dock::showUndockingDialogHelper(PlayerInfo* player)
+        {
+            assert(player);
+
+            if(!player->isHumanPlayer())
+                return;
+
+            if(GameMode::isMaster())
+            {
+                if(GameMode::showsGraphics())
+                    GUIManager::showGUI("UndockingDialog");
+            }
+            else
+                callStaticNetworkFunction(Dock::showDockingDialog, player->getClientID());
+
+        }
 
     void Dock::showDockingDialogHelper(PlayerInfo* player)
@@ -177,4 +245,5 @@
         if (animations_.empty())
             return dockingAnimationFinished(player);
+
         else
             DockingAnimation::invokeAnimation(true, player, animations_);
Index: code/branches/presentationHS13/src/modules/docking/Dock.h
===================================================================
--- code/branches/presentationHS13/src/modules/docking/Dock.h	(revision 9891)
+++ code/branches/presentationHS13/src/modules/docking/Dock.h	(revision 9907)
@@ -62,4 +62,5 @@
             // Trigger interface
             bool execute(bool bTriggered, BaseObject* trigger);
+            bool undocking(bool bTriggered, BaseObject* trigger);
 
             // XML interface
@@ -85,4 +86,6 @@
             void dock()
                 { this->dock(HumanController::getLocalControllerSingleton()->getPlayer()); }
+            void undock()
+                { this->undock(HumanController::getLocalControllerSingleton()->getPlayer()); }
             static unsigned int getNumberOfActiveDocks();
             static Dock* getActiveDockAtIndex(unsigned int index);
@@ -95,4 +98,5 @@
             // Network functions
             void showDockingDialogHelper(PlayerInfo* player);
+            void showUndockingDialogHelper(PlayerInfo* player);
             static void showDockingDialog();
 
Index: code/branches/presentationHS13/src/modules/docking/MoveToDockingTarget.cc
===================================================================
--- code/branches/presentationHS13/src/modules/docking/MoveToDockingTarget.cc	(revision 9891)
+++ code/branches/presentationHS13/src/modules/docking/MoveToDockingTarget.cc	(revision 9907)
@@ -66,6 +66,9 @@
     {
         //TODO: Investigate strange things...
-        this->parent_->detach((WorldEntity*)player->getControllableEntity());
+    	//this->parent_->detach((WorldEntity*)player->getControllableEntity());
 
+    	//TODO: Check the issue with this detach call.
+    	//I have removed the line because the detach call only caused a warning and terminated. And because I didn't find a attach call either.
+    	//Didn't find the need for the line.
         this->parent_->undockingAnimationFinished(player);
         return true;
