Add marker persistence, proximity respawn, and group sync
Markers now survive zone transitions via persistent MarkerDef structs (position + area ID) that are NOT cleared during world teardown. The per-frame tick detects zombie entities (refcount <= 1 from game culling) and respawns markers when the player approaches within 200 yards. New DLL Lua APIs: SetMarkerDef, ClearMarkerDef, GetMarkerDef for the addon to store/query definitions without immediate entity creation. Addon layer adds group sync via CHAT_MSG_ADDON messages using colon- delimited protocol (P:idx:x:y:z:area, C:idx, CA, SR, SF:...). Wraps WorldMarker/ClearWorldMarker to broadcast on placement. Permission model: raid leader/assist or party leader only. Fix lua_pushnumber calling convention: Ghidra confirms it is thiscall (ECX=L, f64 on stack [EBP+8]/[EBP+0xc], ret 8), not fastcall. The patched inreg fastcall was shoving the f64's low dword into EDX, producing garbage values like 1.17e-250 from 1810.
This commit is contained in:
+5
-1
@@ -107,7 +107,8 @@ pub const lua = struct {
|
||||
}
|
||||
|
||||
pub fn pushnumber(L: State, n: f64) void {
|
||||
const f: *const fn (State, f64) callconv(fc) void = @ptrFromInt(0x6F3810);
|
||||
// __thiscall: ECX=L, f64 on stack [EBP+8]/[EBP+0xc], ret 8.
|
||||
const f: *const fn (State, f64) callconv(.{ .x86_thiscall = .{} }) void = @ptrFromInt(0x6F3810);
|
||||
f(L, n);
|
||||
}
|
||||
|
||||
@@ -263,6 +264,9 @@ fn registerLuaFunctions() void {
|
||||
registerFunction("ClearWorldMarker", @intFromPtr(&markers.luaClearWorldMarker));
|
||||
registerFunction("GetPlayerPosition", @intFromPtr(&markers.luaGetPlayerPosition));
|
||||
registerFunction("DistanceToMark", @intFromPtr(&markers.luaDistanceToMark));
|
||||
registerFunction("SetMarkerDef", @intFromPtr(&markers.luaSetMarkerDef));
|
||||
registerFunction("ClearMarkerDef", @intFromPtr(&markers.luaClearMarkerDef));
|
||||
registerFunction("GetMarkerDef", @intFromPtr(&markers.luaGetMarkerDef));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user