Replace manual world object creation with native CreateEntityInstance_WithAttachment API
Markers are now created via the game's high-level entity factory (0x6707c0) which handles spatial registration, render setup, and lifecycle internally. Removed ~300 lines of dead code: manual game object list insertion, A/B mode switching, parity scanning, and model attachment wrappers. Creation works (markers visible). Destruction still crashes — needs correct destructor for entities created via CreateWorldUnit path (not DestroyWorldObjectAndRelease).
This commit is contained in:
@@ -6,7 +6,6 @@ MARKERS_VERSION = 1
|
||||
BINDING_HEADER_MARKERS = "Markers"
|
||||
|
||||
local frame = CreateFrame("Frame")
|
||||
frame:RegisterEvent("ADDON_LOADED")
|
||||
frame:RegisterEvent("PLAYER_LOGIN")
|
||||
|
||||
frame:SetScript("OnEvent", function()
|
||||
@@ -19,27 +18,27 @@ SLASH_MARKERS1 = "/markers"
|
||||
SLASH_MARKERS2 = "/mark"
|
||||
SlashCmdList["MARKERS"] = function(msg)
|
||||
msg = string.lower(msg or "")
|
||||
|
||||
|
||||
if msg == "" or msg == "help" then
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cff00ff00Markers|r commands:")
|
||||
DEFAULT_CHAT_FRAME:AddMessage(" /mark test - Toggle test marker at player position")
|
||||
DEFAULT_CHAT_FRAME:AddMessage(" /mark pos - Show player position")
|
||||
DEFAULT_CHAT_FRAME:AddMessage(" /mark on - Create test marker")
|
||||
DEFAULT_CHAT_FRAME:AddMessage(" /mark off - Destroy test marker")
|
||||
|
||||
DEFAULT_CHAT_FRAME:AddMessage(" /mark pos - Show player position")
|
||||
|
||||
elseif msg == "test" or msg == "toggle" then
|
||||
TestMarkerToggle()
|
||||
|
||||
|
||||
elseif msg == "on" or msg == "create" then
|
||||
TestMarkerCreate()
|
||||
|
||||
|
||||
elseif msg == "off" or msg == "destroy" then
|
||||
TestMarkerDestroy()
|
||||
|
||||
|
||||
elseif msg == "pos" or msg == "position" then
|
||||
local x, y, z = GetPlayerPosition()
|
||||
DEFAULT_CHAT_FRAME:AddMessage(string.format("Position: %.2f, %.2f, %.2f", x, y, z))
|
||||
|
||||
|
||||
else
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cffff0000Unknown command:|r " .. msg)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user