Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Made SyncedUpdate work when multithreading is disabled in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Nov 14, 2023
1 parent 742580f commit 9f5063b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Entities/MovableObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,14 @@ int MovableObject::UpdateScripts(ThreadScriptsToRun scriptsToRun) {

if (status >= 0) {
status = RunScriptedFunctionInAppropriateScripts("Update", false, true, {}, {}, {}, scriptsToRun);

if (status >= 0 && HasRequestedSyncedUpdate()) {
RunScriptedFunctionInAppropriateScripts("SyncedUpdate", false, false, {}, {}, {}, ThreadScriptsToRun::SingleThreaded);
}
}

ResetRequestedSyncedUpdateFlag();

return status;
}

Expand Down
1 change: 0 additions & 1 deletion Managers/MovableMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,6 @@ void MovableMan::Update()
for (MovableObject* mo : luaState.GetRegisteredMOs()) {
if (mo->HasRequestedSyncedUpdate()) {
mo->RunScriptedFunctionInAppropriateScripts(syncedUpdate, false, false, {}, {}, {}, ThreadScriptsToRun::MultiThreaded);
mo->ResetRequestedSyncedUpdateFlag();
}
}

Expand Down

0 comments on commit 9f5063b

Please sign in to comment.