- Timestamp:
- Oct 10, 2018, 3:16:51 PM (6 years ago)
- Location:
- code/branches/mergeFS18
- Files:
-
- 2 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
Note: See TracChangeset
for help on using the changeset viewer.