feat: add SpellStopCasting, name aliases, and targeting stubs

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.
This commit is contained in:
Kelsi 2026-03-22 21:08:18 -07:00
parent e2fec0933e
commit f4d78e5820

View file

@ -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},