From 261dfe0d7679e9a7f987bac9505d07c91e073329 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:06:55 -0500 Subject: [PATCH] Patch highlighted mod on crash screen --- src/pc/lua/smlua_hooks.c | 1 + src/pc/lua/smlua_sync_table.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pc/lua/smlua_hooks.c b/src/pc/lua/smlua_hooks.c index f0e834985..f61a2c822 100644 --- a/src/pc/lua/smlua_hooks.c +++ b/src/pc/lua/smlua_hooks.c @@ -42,6 +42,7 @@ int smlua_call_hook(lua_State* L, int nargs, int nresults, int errfunc, struct M struct Mod* prev = gLuaActiveMod; gLuaActiveMod = activeMod; gLuaLastHookMod = activeMod; + gPcDebug.lastModRun = activeMod; lua_profiler_start_counter(activeMod); diff --git a/src/pc/lua/smlua_sync_table.c b/src/pc/lua/smlua_sync_table.c index 34e16a036..3a984696f 100644 --- a/src/pc/lua/smlua_sync_table.c +++ b/src/pc/lua/smlua_sync_table.c @@ -146,7 +146,7 @@ static void smlua_sync_table_call_hook(int syncTableIndex, int keyIndex, int pre struct Mod* prev = gLuaActiveMod; gLuaActiveMod = mod; gLuaLastHookMod = mod; - gPcDebug.lastModRun = gLuaActiveMod; + gPcDebug.lastModRun = mod; if (0 != smlua_pcall(L, 3, 0, 0)) { LOG_LUA_LINE("Failed to call the hook_on_changed callback"); }