Skip to content

Commit 7359c38

Browse files
committed
Fixed crash due to recursive reloading of activity functions and memory trampling
1 parent 01a7119 commit 7359c38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Activities/GAScripted.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ void GAScripted::Update() {
437437
if (m_ActivityState != ActivityState::Over) {
438438
AddPieSlicesToActiveActorPieMenus();
439439

440+
// Need to call this continually unfortunately, as something might change due to dofile()
441+
RefreshActivityFunctions();
442+
440443
RunLuaFunction("UpdateActivity");
441444

442445
UpdateGlobalScripts(false);
@@ -489,9 +492,6 @@ int GAScripted::RunLuaFunction(const std::string& functionName, const std::vecto
489492
}
490493

491494
int error = g_LuaMan.GetMasterScriptState().RunScriptFunctionObject(funcItr->second.get(), "_G", m_LuaClassName, functionEntityArguments, functionLiteralArguments, functionObjectArguments);
492-
493-
// Need to call this continually unfortunately, as something might change due to dofile()
494-
RefreshActivityFunctions();
495495

496496
return error;
497497
}

0 commit comments

Comments
 (0)