[Orxonox-commit 4325] r8996 - in code/branches/presentation2011: data/levels src/libraries/core src/orxonox/controllers src/orxonox/gametypes

jo at orxonox.net jo at orxonox.net
Sun Dec 18 01:18:52 CET 2011


Author: jo
Date: 2011-12-18 01:18:51 +0100 (Sun, 18 Dec 2011)
New Revision: 8996

Modified:
   code/branches/presentation2011/data/levels/lastTeamStandingII.oxw
   code/branches/presentation2011/data/levels/missionOne.oxw
   code/branches/presentation2011/src/libraries/core/GUIManager.cc
   code/branches/presentation2011/src/orxonox/controllers/FormationController.cc
   code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc
Log:
Repaired xml-interface in order to set a bot's team directly in the level.

Modified: code/branches/presentation2011/data/levels/lastTeamStandingII.oxw
===================================================================
--- code/branches/presentation2011/data/levels/lastTeamStandingII.oxw	2011-12-17 22:49:36 UTC (rev 8995)
+++ code/branches/presentation2011/data/levels/lastTeamStandingII.oxw	2011-12-18 00:18:51 UTC (rev 8996)
@@ -1,6 +1,6 @@
 <LevelInfo
- name = "On the fly"
- description = "Survive as a team."
+ name = "Last Team Standing II"
+ description = "Last Team Standing in an abstract level."
  screenshot = "onthefly.png"
  tags = "gametype"
 />
@@ -15,8 +15,6 @@
 ?>
 
 <Level
- name         = "On the fly"
- description  = "testmap for gametype last team standing"
  gametype     = "LastTeamStanding"
 >
   <templates>

Modified: code/branches/presentation2011/data/levels/missionOne.oxw
===================================================================
--- code/branches/presentation2011/data/levels/missionOne.oxw	2011-12-17 22:49:36 UTC (rev 8995)
+++ code/branches/presentation2011/data/levels/missionOne.oxw	2011-12-18 00:18:51 UTC (rev 8996)
@@ -20,8 +20,6 @@
 ?>
 
 <Level
- name         = "Mission One"
- description  = "How to steer a spaceship."
  gametype     = "Mission"
 >
   <templates>

Modified: code/branches/presentation2011/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/presentation2011/src/libraries/core/GUIManager.cc	2011-12-17 22:49:36 UTC (rev 8995)
+++ code/branches/presentation2011/src/libraries/core/GUIManager.cc	2011-12-18 00:18:51 UTC (rev 8996)
@@ -222,7 +222,7 @@
     static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
 
     GUIManager* GUIManager::singletonPtr_s = 0;
-    /*static*/ const std::string GUIManager::defaultScheme_ = "Orxonox"; //TaharezGreen
+    /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen"; //Alternative: Orxonox (not fully complete yet, see the graphics menu)
 
     SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false);
     SetConsoleCommand("hideGUI", &GUIManager::hideGUI);

Modified: code/branches/presentation2011/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/FormationController.cc	2011-12-17 22:49:36 UTC (rev 8995)
+++ code/branches/presentation2011/src/orxonox/controllers/FormationController.cc	2011-12-18 00:18:51 UTC (rev 8996)
@@ -128,6 +128,7 @@
     {
         SUPER(FormationController, XMLPort, xmlelement, mode);
 
+        XMLPortParam(FormationController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
         XMLPortParam(FormationController, "formationFlight", setFormationFlight, getFormationFlight, xmlelement, mode).defaultValues(false);
         XMLPortParam(FormationController, "formationSize", setFormationSize, getFormationSize, xmlelement, mode).defaultValues(STANDARD_MAX_FORMATION_SIZE);
         XMLPortParam(FormationController, "passive", setPassive, getPassive, xmlelement, mode).defaultValues(false);

Modified: code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc	2011-12-17 22:49:36 UTC (rev 8995)
+++ code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc	2011-12-18 00:18:51 UTC (rev 8996)
@@ -48,7 +48,7 @@
         this->teams_ = 2; //most team gametypes use two different teams
         this->allowFriendlyFire_ = false;
         //this->playersPerTeam_ = 0;
-        this->maxPlayers_ = 2; //TEST
+        this->maxPlayers_ = 0; //Value "0": no limit is set.
         this->setConfigValues();
     }
 
@@ -74,8 +74,8 @@
 
     void TeamGametype::playerEntered(PlayerInfo* player)
     {
+        if(player == NULL) return; // catch null pointers
         Gametype::playerEntered(player);
-        if(player == NULL) return;
         this->findAndSetTeam(player);
         if( this->players_.size() <= maxPlayers_ || maxPlayers_  ==  0)
         {
@@ -90,7 +90,8 @@
 
     void TeamGametype::findAndSetTeam(PlayerInfo* player)
     {
-         std::vector<unsigned int> playersperteam(this->teams_, 0);
+        if(player == NULL) return; // catch null pointers
+        std::vector<unsigned int> playersperteam(this->teams_, 0);
 
         for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
             if (it->second < static_cast<int>(this->teams_) && it->second >= 0)
@@ -120,8 +121,8 @@
             {
                  if(it->second == false) // waiting player found
                  {it->second = true; break;} // allow player to enter
-			}
-		}
+            }
+        }
 
         if (valid_player)
         {   // clean up the maps
@@ -139,7 +140,7 @@
         {
             if(allowedInGame_[it->first] == false)//check if dead player is allowed to enter
             {
-				continue;
+                continue;
             }
             if (it->second.state_ == PlayerState::Dead)
             {




More information about the Orxonox-commit mailing list