Changeset 8211 in orxonox.OLD for branches/script_engine/src/lib/script_engine/script_trigger.cc
- Timestamp:
- Jun 7, 2006, 8:47:05 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/lib/script_engine/script_trigger.cc
r8208 r8211 7 7 { 8 8 scriptCalled = false; 9 callScript = false; 10 triggered = false; 9 scriptIsOk = false; 11 10 loadParams(root); 12 11 … … 24 23 { 25 24 WorldEntity ::loadParams(root); 26 25 27 26 { LoadParam(root, "file", this, ScriptTrigger, setScript) 28 27 .describe("the fileName of the script, that should be triggered by this script trigger") … … 50 49 timer = delay; 51 50 } 52 51 53 52 } 54 53 … … 57 56 { 58 57 BaseObject* targetEntity = ClassList::getObject(target, CL_WORLD_ENTITY); 59 58 60 59 if (targetEntity != NULL) 61 60 { … … 71 70 { 72 71 BaseObject* parentEntity = ClassList::getObject(parent, CL_WORLD_ENTITY); 73 72 74 73 if (parentEntity != NULL) 75 74 { … … 105 104 void ScriptTrigger::executeAction() 106 105 { 107 ScriptManager* scriptManager = ScriptManager::getInstance(); 108 Script* script = scriptManager->getScriptByFile(this->scriptFile); 109 if(script != NULL) 106 if(scriptIsOk) 110 107 { 111 108 if(!(script->selectFunction(this->functionName,0)) ) … … 115 112 } 116 113 } 114 115 116 void ScriptTrigger::setScript(const std::string& file) 117 { 118 ScriptManager* scriptManager = ScriptManager::getInstance(); 119 script = scriptManager->getScriptByFile(file); 120 if(script != NULL) 121 scriptIsOk = true; 122 123 }
Note: See TracChangeset
for help on using the changeset viewer.