Changeset 10565 in orxonox.OLD for branches/scriptimprovements/src/world_entities/script_trigger.cc
- Timestamp:
- Feb 3, 2007, 12:21:51 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/scriptimprovements/src/world_entities/script_trigger.cc
r10564 r10565 60 60 scriptCalled = false; 61 61 scriptIsOk = false; 62 executionStopped = false; // true when something goes wrong and the trigger has to be stopped 62 63 triggerRemains = true; 63 64 addToScript = false; … … 209 210 void ScriptTrigger::executeAction(float timestep) 210 211 { 212 if(executionStopped && scriptIsOk) // If the script has been loaded correctly but something is wrong with the settings of the trigger 213 { 214 PRINT(1)("ERROR SCRTIPTTRIGGER: Something went wrong while executing %s in %s . Execution stopped! \n", functionName.c_str(), script->getFileName().c_str()); 215 return; 216 } 217 211 218 if(scriptIsOk) 212 219 { … … 215 222 { 216 223 PRINT(1)("ERROR SCRTIPTTRIGGER : Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 224 executionStopped = true; //Since the triggersettings won't change on runtime, it makes no sense to call the function again. 217 225 return; 218 226 } 219 227 220 228 if (! (script->pushParam( timestep, this->functionName)) ) 229 { 230 executionStopped = true; //Since the triggersettings won't change on runtime, it makes no sense to call the function again. 221 231 return; 222 232 } 223 233 if( !(script->executeFunction()) ) 224 234 { 225 235 PRINT(1)("ERROR SCRTIPTTRIGGER : Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str()); 236 executionStopped = true; //Since the triggersettings won't change on runtime, it makes no sense to call the function again. 226 237 return; 227 238 }
Note: See TracChangeset
for help on using the changeset viewer.