From f4d78e58207641e2c0aa7188c9576710051d594c Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 22 Mar 2026 21:08:18 -0700 Subject: [PATCH] feat: add SpellStopCasting, name aliases, and targeting stubs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SpellStopCasting() cancels the current cast via cancelCast(). Used by macro addons and cast-cancel logic (e.g., /stopcasting macro command). UnitFullName/GetUnitName aliases for UnitName — some addons use these variant names. SpellIsTargeting() returns false (no AoE targeting reticle in this client). SpellStopTargeting() is a no-op stub. Both prevent errors in addons that check targeting state. --- src/addons/lua_engine.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/addons/lua_engine.cpp b/src/addons/lua_engine.cpp index c6a509f8..aec65ae0 100644 --- a/src/addons/lua_engine.cpp +++ b/src/addons/lua_engine.cpp @@ -4858,6 +4858,20 @@ void LuaEngine::registerCoreAPI() { // Unit API static const struct { const char* name; lua_CFunction func; } unitAPI[] = { {"UnitName", lua_UnitName}, + {"UnitFullName", lua_UnitName}, + {"GetUnitName", lua_UnitName}, + {"SpellStopCasting", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + if (gh) gh->cancelCast(); + return 0; + }}, + {"SpellStopTargeting", [](lua_State* L) -> int { + (void)L; return 0; // No targeting reticle in this client + }}, + {"SpellIsTargeting", [](lua_State* L) -> int { + lua_pushboolean(L, 0); // No AoE targeting reticle + return 1; + }}, {"UnitHealth", lua_UnitHealth}, {"UnitHealthMax", lua_UnitHealthMax}, {"UnitPower", lua_UnitPower},