diff --git a/DLL_README.md b/DLL_README.md index 070afa3..45bbada 100644 --- a/DLL_README.md +++ b/DLL_README.md @@ -46,13 +46,15 @@ A keybinding is available in the Key Bindings menu. ### Interact -Smart interaction for faster farming and dungeon runs: +Smart interaction helpers for faster farming and dungeon runs: - **Interact Nearest** -- right-clicks the closest interactable NPC or object within 5 yards +- **Loot All Corpses** -- bulk loots all nearby corpses in sequence Best used via keybindings (available in the Key Bindings menu) or macros: ``` /run InteractNearest(1) +/run LootAllCorpses() ``` **DLL:** `interact.dll` diff --git a/src/interact/addon/Interact.toc b/src/interact/addon/Interact.toc index 9d59306..e0b84a4 100644 --- a/src/interact/addon/Interact.toc +++ b/src/interact/addon/Interact.toc @@ -5,4 +5,3 @@ ## Dependencies: WeirdUtils Interact.lua -Bindings.xml diff --git a/src/main.zig b/src/main.zig index a47a080..33c0ee7 100644 --- a/src/main.zig +++ b/src/main.zig @@ -953,13 +953,16 @@ const modules = [_]ModuleHooks{ if (build_opts.transmogfix) .{ .install = transmogfix.installHooks, .remove = transmogfix.removeHooks } else .{}, if (build_opts.minimapicons) .{ .install = minimapicons.installHooks, .remove = minimapicons.removeHooks } else .{}, if (build_opts.healtextfix) .{ .install = healtextfix.installHooks, .remove = healtextfix.removeHooks } else .{}, - if (build_opts.markers) .{ .install = markers.installHooks, .remove = markers.removeHooks, .remove_on_shutdown = true } else .{}, + if (build_opts.markers) .{ .install = markers.installHooks, .remove = markers.removeHooks } else .{}, if (build_opts.interact) .{ .install = interact.installHooks, .remove = interact.removeHooks } else .{}, if (build_opts.outline) .{ .remove = outline.cleanup } else .{}, if (build_opts.screenshot) .{ .remove = screenshot.removeHook } else .{}, }; fn shutdownDetour() callconv(sc) void { + // Clear marker definitions on logout/exit (not on map change). + if (build_opts.markers) markers.onShutdown(); + // Clean up world objects BEFORE game shutdown — atexit handlers run before // DllMain so modules with remove_on_shutdown must destroy here. comptime var i = modules.len; diff --git a/src/markers/addon/Bindings.xml b/src/markers/addon/Bindings.xml index 3ae9be8..55700d8 100644 --- a/src/markers/addon/Bindings.xml +++ b/src/markers/addon/Bindings.xml @@ -1,17 +1,17 @@ - + WorldMarker(1) - + WorldMarker(2) - + WorldMarker(3) - + WorldMarker(4) - + WorldMarker(5) diff --git a/src/markers/addon/Markers.toc b/src/markers/addon/Markers.toc index ada3133..4e443dd 100644 --- a/src/markers/addon/Markers.toc +++ b/src/markers/addon/Markers.toc @@ -5,4 +5,3 @@ ## Dependencies: WeirdUtils Markers.lua -Bindings.xml diff --git a/src/markers/markers.zig b/src/markers/markers.zig index 2b0cda2..1a6b191 100644 --- a/src/markers/markers.zig +++ b/src/markers/markers.zig @@ -766,6 +766,14 @@ pub fn installHooks() void { } } +/// Called from CGGameUI_Shutdown (logout/exit) — wipes marker definitions. +/// Does NOT touch hooks or mutex. Entities are destroyed separately by +/// worldCleanupDetour which fires after shutdown. +pub fn onShutdown() void { + for (&marker_defs) |*d| d.* = EMPTY_DEF; + con.print("[markers] defs cleared (shutdown)\n"); +} + pub fn removeHooks() void { if (g_is_hook_owner) { // destroyAllEntities is idempotent — if worldCleanupDetour already ran, diff --git a/src/outline/addon/Outline.toc b/src/outline/addon/Outline.toc index bccac70..37832c4 100644 --- a/src/outline/addon/Outline.toc +++ b/src/outline/addon/Outline.toc @@ -5,4 +5,3 @@ ## Dependencies: WeirdUtils Outline.lua -Bindings.xml diff --git a/src/screenshot/addon/Screenshot.toc b/src/screenshot/addon/Screenshot.toc index 272384f..a476a3a 100644 --- a/src/screenshot/addon/Screenshot.toc +++ b/src/screenshot/addon/Screenshot.toc @@ -5,4 +5,3 @@ ## Dependencies: WeirdUtils Screenshot.lua -Bindings.xml