From 5c619282605b04711e95b2b0aad060e75b196510 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Thu, 3 Sep 2026 10:49:40 +0200 Subject: [PATCH] safety: keep GC native until player is in world --- experiments/wp24b-gc/main.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/experiments/wp24b-gc/main.zig b/experiments/wp24b-gc/main.zig index 7528bdc..3b9c122 100644 --- a/experiments/wp24b-gc/main.zig +++ b/experiments/wp24b-gc/main.zig @@ -17,6 +17,7 @@ const X86_FASTCALL: std.builtin.CallingConvention = .{ .x86_fastcall = .{} }; const LUA_COLLECT_GARBAGE_ADDR: usize = 0x6F7340; const LUA_CLOSE_ADDR: usize = 0x6F6EF0; const BIRTH_MARK_ADDR: usize = 0x6F7B37; +const IS_IN_WORLD_ADDR: u32 = 0x00B4B424; const GS_ROOTGC: u32 = 0x10; const GS_ROOTUDATA: u32 = 0x14; @@ -207,6 +208,13 @@ fn collectGarbageDetour(L: u32) callconv(X86_FASTCALL) void { collect_hook.callOriginal(.{L}); return; } + + // Keep GlueXML/login/character-select on WoW's native GC. + // The experiment is intentionally gameplay-only. + if (readU32(IS_IN_WORLD_ADDR) == 0) { + collect_hook.callOriginal(.{L}); + return; + } if (in_gc) return; if (L == 0) return; if (readU32(L + 0x60) == 0) return;