mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 09:03:51 +00:00
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:
parent
e2fec0933e
commit
f4d78e5820
1 changed files with 14 additions and 0 deletions
|
|
@ -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},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue