diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index 99b110bd..af2d4deb 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -2101,9 +2101,6 @@ void mapclass::twoframedelayfix() game.state = 0; game.statedelay = 0; script.load(game.newscript); - if (script.running) - { - script.run(); - script.dontrunnextframe = true; - } + script.run(); + script.dontrunnextframe = true; } diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 17c59726..a7f41fdc 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -79,6 +79,11 @@ void scriptclass::tokenize( const std::string& t ) void scriptclass::run() { + if (!running) + { + return; + } + // This counter here will stop the function when it gets too high short execution_counter = 0; while(running && scriptdelay<=0 && !game.pausescript) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index a707d684..c3b922c3 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -556,7 +556,7 @@ void inline fixedloop() { script.dontrunnextframe = false; } - else if (script.running) + else { script.run(); } @@ -586,10 +586,7 @@ void inline fixedloop() } else { - if (script.running) - { - script.run(); - } + script.run(); gameinput(); } maplogic();