Index: code/branches/gamecontent/data/levels/lastTeamStanding.oxw
===================================================================
--- code/branches/gamecontent/data/levels/lastTeamStanding.oxw	(revision 8955)
+++ code/branches/gamecontent/data/levels/lastTeamStanding.oxw	(revision 8956)
@@ -17,5 +17,5 @@
  name         = "Last Team Standing"
  description  = "testmap for gametype last team standing"
- gametype     =  "LastTeamStanding"
+ gametype     =  "TeamGametype"
 >
   <templates>
Index: code/branches/gamecontent/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/gametypes/Gametype.cc	(revision 8955)
+++ code/branches/gamecontent/src/orxonox/gametypes/Gametype.cc	(revision 8956)
@@ -133,5 +133,5 @@
                     this->gtinfo_->playerReadyToSpawn(it->first);
             }
-                    
+
             this->checkStart();
         }
@@ -440,5 +440,5 @@
             if(player->isHumanPlayer())
                 this->gtinfo_->playerSpawned(player);
-            
+
             this->playerPostSpawn(player);
         }
Index: code/branches/gamecontent/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/branches/gamecontent/src/orxonox/gametypes/Gametype.h	(revision 8955)
+++ code/branches/gamecontent/src/orxonox/gametypes/Gametype.h	(revision 8956)
@@ -126,7 +126,4 @@
             void killBots(unsigned int amount = 0);
 
-            inline unsigned int getNumberOfPlayers() const
-                { return this->players_.size(); }
-
             virtual void addTime(float t);
             virtual void removeTime(float t);
@@ -151,5 +148,5 @@
 
             //inline bool getForceSpawn()
-            //  { return this->bForceSpawn_; }       
+            //  { return this->bForceSpawn_; }
 
             virtual void resetTimer();
Index: code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc	(revision 8955)
+++ code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc	(revision 8956)
@@ -46,8 +46,8 @@
         RegisterObject(TeamGametype);
 
-        this->teams_ = 2;
+        this->teams_ = 2; //most team gametypes use two different teams
         this->allowFriendlyFire_ = false;
         //this->playersPerTeam_ = 0;
-        this->maxPlayers_ = 0;
+        this->maxPlayers_ = 2; //TEST
         this->setConfigValues();
     }
@@ -78,8 +78,13 @@
         if(player == NULL) return;
         this->findAndSetTeam(player);
-        if( getNumberOfPlayers() < maxPlayers_ || maxPlayers_  ==  0)
+        if( this->players_.size() <= maxPlayers_ || maxPlayers_  ==  0)
+        {
             this->allowedInGame_[player]= true;
+        }
         else
+        {
             this->allowedInGame_[player]= false;
+            orxout() << "not allowed in game: players = " << this->players_.size() << " > maximum: " << maxPlayers_ << endl;
+        }
     }
 
@@ -110,7 +115,19 @@
     {
         bool valid_player = Gametype::playerLeft(player);
+        if( (this->players_.size() >= maxPlayers_) && (allowedInGame_[player] == true) ) // if there's a "waiting list"
+        {
+            for (std::map<PlayerInfo*, bool>::iterator it = this->allowedInGame_.begin(); it != this->allowedInGame_.end(); ++it)
+            {
+                 if(it->second == false) // waiting player found
+                 {it->second = true; break;} // allow player to enter
+			}
+		}
 
         if (valid_player)
+        {   // clean up the maps
             this->teamnumbers_.erase(player);
+            this->allowedInGame_.erase(player);
+        }
+
 
         return valid_player;
@@ -121,6 +138,8 @@
         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)\
         {
-            if(true)//check if dead player is allowed to enter -> if maximum nr of players is exceeded & player was not in game before: disallow
-                //continue;
+            if(allowedInGame_[it->first] == false)//check if dead player is allowed to enter
+            {
+				continue;
+            }
             if (it->second.state_ == PlayerState::Dead)
             {
@@ -135,5 +154,5 @@
 
     bool TeamGametype::allowPawnHit(Pawn* victim, Pawn* originator)
-    {// hit allowed: if victim & originator are foes or if originator doesnot exist or if friendlyfire is allowed 
+    {// hit allowed: if victim & originator are foes or if originator doesnot exist or if friendlyfire is allowed
         return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
     }
@@ -262,5 +281,5 @@
         if(pawn == NULL)
             return;
-        
+
         int teamnumber = pawn->getTeam();
 
@@ -292,5 +311,5 @@
     void TeamGametype::colourPawn(Pawn* pawn, int teamNr)
     {// catch no-colouring-case and wrong input
-        if(teamNr < 0 || pawn == NULL) return; 
+        if(teamNr < 0 || pawn == NULL) return;
         pawn->setRadarObjectColour(this->teamcolours_[teamNr]);
 
Index: code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h
===================================================================
--- code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h	(revision 8955)
+++ code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h	(revision 8956)
@@ -67,10 +67,10 @@
             bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
 
-            bool allowFriendlyFire_; //<! friendlyfire is per default switched off: friendlyFire_ = false;
+            bool allowFriendlyFire_; //!< friendlyfire is per default switched off: friendlyFire_ = false;
             std::map<PlayerInfo*, int> teamnumbers_;
             std::vector<ColourValue> teamcolours_;
-            unsigned int teams_; //<! Number  of teams. Value 0 : no teams!
-            //unsigned int playersPerTeam_; //<! Defines Maximum for players per team. Value 0: no maximum!
-            unsigned int maxPlayers_;  //<! Defines Maximum for number of players. Value 0 : no maximum!
+            unsigned int teams_; //!< Number  of teams. Value 0 : no teams!
+            //unsigned int playersPerTeam_; //!< Defines Maximum for players per team. Value 0: no maximum!
+            unsigned int maxPlayers_; //!< Defines Maximum for number of players. Value 0 : no maximum!
             std::map<PlayerInfo*, bool> allowedInGame_; //!< Only those players are allowed to spawn which are listed here as 'true'.
             void setTeamColour(PlayerInfo* player, Pawn* pawn);
