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

Commit

Permalink
bit more thread safety
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Nov 4, 2023
1 parent 67cfff7 commit 8d07073
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lua/LuaAdapters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,9 @@ namespace RTE {
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void LuaAdaptersMovableObject::SendMessage2(MovableObject *luaSelfObject, const std::string &message, luabind::object context) {
// We're not transferring context between lua states, so only run singlethreaded scripts when we have context
LuabindObjectWrapper wrapper(&context, "", false);
luaSelfObject->RunScriptedFunctionInAppropriateScripts("OnMessage", false, false, {}, { message }, { &wrapper });
luaSelfObject->RunScriptedFunctionInAppropriateScripts("OnMessage", false, false, {}, { message }, { &wrapper }, ThreadScriptsToRun::SingleThreaded);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 8d07073

Please sign in to comment.