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;