Index: /code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc
===================================================================
--- /code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc	(revision 7484)
+++ /code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc	(revision 7485)
@@ -26,8 +26,5 @@
  *
  */
-//Haupt-Problem: Wie kann ich Spieler vom Spiel ausschliessen, wenn sie alle Leben verlohren haben? (Kann man respawn unterbinden?)
-//Aktuelle Notloesung: Spieler wird unsichtbar und kann keinen Schaden austeilen, aber: setradarinvisibility funktioniert scheinbar nicht
-//Lösungsidee2: Spieler werden als passive Drohnen respawned, wenn sie keine Leben mehr haben (noch nicht implementiert)
-//
+
 #include "LastManStanding.h"
 
@@ -46,5 +43,5 @@
         RegisterObject(LastManStanding);
         this->bForceSpawn_=true;
-        this->lives=2;
+        this->lives=4;
         this->playersAlive=0;
         this->timeRemaining=20.0f;
@@ -53,24 +50,13 @@
     void LastManStanding::setConfigValues()
     {
-         SetConfigValue(lives, 2);
-    }
-
-    bool LastManStanding::allowPawnHit(Pawn* victim, Pawn* originator)
+        SetConfigValue(lives, 4);
+        SetConfigValue(timeRemaining, 20.0f);
+    }
+
+    bool LastManStanding::allowPawnDamage(Pawn* victim, Pawn* originator)
     {
         if (originator && originator->getPlayer())// only for safety
         {
-            if(playerLives_[originator->getPlayer()]< 0) //dead players shouldn't be able to hit any pawn
-                return false;
-        }
-        return true;
-    }
-
-    bool LastManStanding::allowPawnDamage(Pawn* victim, Pawn* originator)
-    {
-        if (originator && originator->getPlayer())// only for safety
-        {
             this->timeToAct_[originator->getPlayer()]=timeRemaining;
-            if(playerLives_[originator->getPlayer()]< 0) //dead players shouldn't be able to damage any pawn
-                return false;
         }
 
@@ -163,22 +149,4 @@
     }
 
-    void LastManStanding::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)//makes dead players invisible
-    {
-        if (playerLives_[pawn->getPlayer()]<=0)//if player is dead
-        {
-            pawn->setVisible(false);
-            pawn->setRadarVisibility(false);
-            //removePlayer(pawn->getPlayer());
-        }
-    }
-    void LastManStanding::pawnPostSpawn(Pawn* pawn)
-    {/*
-        if (playerLives_[pawn->getPlayer()]<=0)//if player is dead
-        {
-            pawn->setVisible(false);  --->Seltsames Verhalten, wenn diese Zeile aktiv ist
-            pawn->setRadarVisibility(false);
-        }  */
-    }
-
     void LastManStanding::pawnKilled(Pawn* victim, Pawn* killer)
     {
@@ -229,17 +197,4 @@
                 Host::Broadcast(message);
             }
-            /*
-                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator());
-                if (victim->getCamera())
-                {
-                    entity->setPosition(victim->getCamera()->getWorldPosition());
-                    entity->setOrientation(victim->getCamera()->getWorldOrientation());
-                }
-                else
-                {
-                    entity->setPosition(victim->getWorldPosition());
-                    entity->setOrientation(victim->getWorldOrientation());
-                }
-                it->first->startControl(entity);*/
         }
     }
@@ -267,32 +222,14 @@
     }
 
-    /*void LastManStanding::removePlayer(PlayerInfo* player) //----------> Dieser Versuch führt zu einem Programmabsturz 
-    {
-        std::map<PlayerInfo*, Player>::const_iterator it = this->players_.find(player);
-        if (it != this->players_.end())
-        {
-            if (it->first->getControllableEntity())
-            {
-                ControllableEntity* oldentity = it->first->getControllableEntity();
-
-                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(oldentity);
-                if (oldentity->getCamera())
-                {
-                    entity->setPosition(oldentity->getCamera()->getWorldPosition());
-                    entity->setOrientation(oldentity->getCamera()->getWorldOrientation());
-                }
-                else
-                {
-                    entity->setPosition(oldentity->getWorldPosition());
-                    entity->setOrientation(oldentity->getWorldOrientation());
-                }
-
-                it->first->startControl(entity);
-            }
-            else
-                this->spawnPlayerAsDefaultPawn(it->first);
-        }
-
-    }*/
+    void LastManStanding::spawnDeadPlayersIfRequested()
+    {
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (it->second.state_ == PlayerState::Dead)
+            {
+                bool alive = (0<playerLives_[it->first]);
+                if (alive&&(it->first->isReadyToSpawn() || this->bForceSpawn_))
+                    this->spawnPlayer(it->first);
+             }
+    }
 
 }
Index: /code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h
===================================================================
--- /code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h	(revision 7484)
+++ /code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h	(revision 7485)
@@ -31,8 +31,8 @@
 */
 /* BY THE WAY
-//You have to add bots (or any other further players) before actually starting a match.
+//!You have to ADD BOTS (or any other further players) BEFORE actually starting a match!
+//Maybe a warning should be added in the menu, if a player starts a Last Man Standing match alone.
 //Whenever there is only on player in the game, this player will be declared as winner.
-//How "death" is managed: Death players become invisivle and aren't allowed to damage any player.
-//Though they can recieve damage and they are not invisible on the radar-
+//How "death" is managed: dead players cannot respawn.
 */
 #ifndef _LastManStanding_H__
@@ -55,9 +55,10 @@
     */
         protected:
-            int lives; //!< Standard amount of lives.
+            int lives; //!< Standard amount of lives. Each player starts a game with so many lives.
             std::map< PlayerInfo*, int > playerLives_; //!< Each player's lives are stored here.
             int playersAlive; //!< Counter counting players with more than 0 lives.
             float timeRemaining; //!< Each player has a certain time where he or she has to hit an opponent or will be punished.
             std::map<PlayerInfo*, float> timeToAct_; //!< Each player's time till she/he will be punished is stored here.
+            virtual void spawnDeadPlayersIfRequested();
 
         public:
@@ -66,6 +67,5 @@
             void setConfigValues(); //!< Makes values configurable.
 
-            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0); //!< Prevents hits by players with no lives.
-            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0); //!< If a player shoot's an opponet, his punishment countdown will be resetted. Prevents damage by players with no lives.
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0); //!< If a player shoot's an opponet, his punishment countdown will be resetted.
             virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0); //!< Manages each lives.
 
@@ -76,11 +76,8 @@
             virtual bool playerChangedName(PlayerInfo* player);
 
-            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);//makes dead players invisible
-            virtual void pawnPostSpawn(Pawn* pawn); //just for test case
             virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
 
             const int playerGetLives(PlayerInfo* player);
             void killPlayer(PlayerInfo* player);
-            //void removePlayer(PlayerInfo* player);
             void tick (float dt);// used to end the game
     };
