Skip to content

Commit

Permalink
Keep main script to be executed before custom scripts. (#235)
Browse files Browse the repository at this point in the history
* Keep main script in to be executed before custom scripts.

* fixup! Keep main script in to be executed before custom scripts.
  • Loading branch information
MiranDMC authored Nov 30, 2024
1 parent aba9aa8 commit 27e9f27
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/CScriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,22 @@ namespace CLEO

GetInstance().ModuleSystem.LoadCleoModules();
LoadState(GetInstance().saveSlot);

// keep already loaded scripts at front of processing queue
auto head = *activeThreadQueue;

auto tail = head;
while (tail->Next) tail = tail->Next;

// load custom scripts as new list
*activeThreadQueue = nullptr;
LoadCustomScripts();

// append custom scripts list to the back
tail->Next = *activeThreadQueue;
(*activeThreadQueue)->Previous = tail;

*activeThreadQueue = head; // restore original
}

void CScriptEngine::GameEnd()
Expand Down

0 comments on commit 27e9f27

Please sign in to comment.