diff options
Diffstat (limited to 'src/game/World.cpp')
| -rw-r--r-- | src/game/World.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/game/World.cpp b/src/game/World.cpp index 5c40acd9c40..f7e10c62dc9 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1631,7 +1631,7 @@ void World::ForceGameEventUpdate() } /// Put scripts in the execution queue -void World::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target) +void World::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target, bool start) { ///- Find the script map ScriptMapMap::const_iterator s = scripts.find(id); @@ -1659,7 +1659,7 @@ void World::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, immedScript = true; } ///- If one of the effects should be immediate, launch the script execution - if (immedScript) + if (start && immedScript) ScriptsProcess(); } @@ -2367,12 +2367,9 @@ void World::ScriptsProcess() break; uint32 script_id = step.script->datalong2; - //delete iter and return it to begin pos(next one) - m_scriptSchedule.erase(iter); - iter = m_scriptSchedule.begin(); - - ScriptsStart(*datamap, script_id, target, NULL); - return; + //insert script into schedule but do not start it + ScriptsStart(*datamap, script_id, target, NULL, false); + break; } case SCRIPT_COMMAND_PLAYSOUND: |
