[Orxonox-commit 7284] r11901 - in code/branches/ScriptableController_FS18/src/orxonox: infos scriptablecontroller
adamc at orxonox.net
adamc at orxonox.net
Tue Apr 24 13:36:15 CEST 2018
Author: adamc
Date: 2018-04-24 13:36:15 +0200 (Tue, 24 Apr 2018)
New Revision: 11901
Modified:
code/branches/ScriptableController_FS18/src/orxonox/infos/GametypeInfo.cc
code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
Log:
scriptablecontroller fixed respawn reexecution
Modified: code/branches/ScriptableController_FS18/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/branches/ScriptableController_FS18/src/orxonox/infos/GametypeInfo.cc 2018-04-24 11:10:36 UTC (rev 11900)
+++ code/branches/ScriptableController_FS18/src/orxonox/infos/GametypeInfo.cc 2018-04-24 11:36:15 UTC (rev 11901)
@@ -298,6 +298,7 @@
this->spawnedPlayers_.erase(player);
this->setReadyToSpawnHelper(player, false);
this->setSpawnedHelper(player, false);
+
}
}
@@ -316,7 +317,7 @@
}
// TODO We might want to handle the subsequent spawns as well somehow
- if(player->isHumanPlayer() && player->isLocalPlayer() && this->isFirstSpawn_)
+ if(player->isHumanPlayer() && player->isLocalPlayer()) //&& this->isFirstSpawn_)
{
this->isFirstSpawn_ = false;
this->getLevel()->getScriptableController()->setPlayer(player);
@@ -359,8 +360,17 @@
if( player->isHumanPlayer() )
{
// Display "Press [Fire] to start the match" if the game has not yet ended.
- if(!this->hasEnded())
+ if(!this->hasEnded()){
NotificationListener::sendNotification("Press [Fire] to start the match", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
+
+ //this->getLevel()->getScriptableController()->setPlayer(player);
+
+ // This handles paths relative to the 'level' directory
+ //std::string script = this->getLevel()->getScript();
+ //if(script.at(0) != '/')
+ //script = "../levels/" + script; // Not very dynamic
+ //this->getLevel()->getScriptableController()->runScript(script);
+ }
// Else display "Game has ended".
else
NotificationListener::sendNotification("Game has ended", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
Modified: code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
===================================================================
--- code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc 2018-04-24 11:10:36 UTC (rev 11900)
+++ code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc 2018-04-24 11:36:15 UTC (rev 11901)
@@ -151,6 +151,7 @@
else
{
orxout(user_warning) << "Script tried to spawn an object that is neither a WorldEntity, nor a PlayerInfo" << std::endl;
+
return;
}
@@ -360,4 +361,6 @@
return z;
}
+ //void ScriptableControllerAPI::moveEntity(std::string id, double x, double y, double z)
+
}
More information about the Orxonox-commit
mailing list