Changeset 12028 for code/branches/mergeFS18/src/orxonox/infos
- Timestamp:
- Oct 10, 2018, 3:16:51 PM (6 years ago)
- Location:
- code/branches/mergeFS18
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/mergeFS18
- Property svn:mergeinfo changed
-
code/branches/mergeFS18/src/orxonox/infos/GametypeInfo.cc
r11099 r12028 43 43 #include "interfaces/GametypeMessageListener.h" 44 44 #include "interfaces/NotificationListener.h" 45 #include "scriptablecontroller/scriptable_controller.h" 46 #include "Level.h" 45 47 46 48 #include "PlayerInfo.h" … … 76 78 this->spawned_ = false; 77 79 this->readyToSpawn_ = false; 80 this->isFirstSpawn_ = true; 78 81 79 82 this->registerVariables(); … … 296 299 this->setReadyToSpawnHelper(player, false); 297 300 this->setSpawnedHelper(player, false); 301 298 302 } 299 303 } … … 310 314 { 311 315 if(this->hasStarted() && !this->hasEnded()) 312 313 316 this->setSpawnedHelper(player, true); 317 } 318 319 // TODO We might want to handle the subsequent spawns as well somehow 320 if(player->isHumanPlayer() && player->isLocalPlayer()) //&& this->isFirstSpawn_) 321 { 322 this->isFirstSpawn_ = false; 323 this->getLevel()->getScriptableController()->setPlayer(player); 324 325 // This handles paths relative to the 'level' directory 326 std::string script = this->getLevel()->getScript(); 327 if(script.at(0) != '/') 328 script = "../levels/" + script; // Not very dynamic 329 this->getLevel()->getScriptableController()->runScript(script); 314 330 } 315 331 } … … 345 361 { 346 362 // Display "Press [Fire] to start the match" if the game has not yet ended. 347 if(!this->hasEnded()) 363 if(!this->hasEnded()){ 348 364 NotificationListener::sendNotification("Press [Fire] to start the match", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID()); 365 366 //this->getLevel()->getScriptableController()->setPlayer(player); 367 368 // This handles paths relative to the 'level' directory 369 //std::string script = this->getLevel()->getScript(); 370 //if(script.at(0) != '/') 371 //script = "../levels/" + script; // Not very dynamic 372 //this->getLevel()->getScriptableController()->runScript(script); 373 } 349 374 // Else display "Game has ended". 350 375 else -
code/branches/mergeFS18/src/orxonox/infos/GametypeInfo.h
r11720 r12028 83 83 inline bool isStartCountdownRunning() const 84 84 { return this->bStartCountdownRunning_; } 85 85 86 void changedStartCountdownRunning(void); // Is called when the start countdown has been either started or stopped. 86 87 … … 166 167 bool spawned_; //!< Whether the local Player is currently spawned. 167 168 bool readyToSpawn_; //!< Whether the local Player is ready to spawn. 169 bool isFirstSpawn_; 168 170 }; 169 171 } -
code/branches/mergeFS18/src/orxonox/infos/HumanPlayer.cc
r11071 r12028 38 38 #include "gametypes/Gametype.h" 39 39 #include "overlays/OverlayGroup.h" 40 #include "Level.h" 41 #include "scriptablecontroller/scriptable_controller.h" 40 42 41 43 namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.