Commit Graph
12 Commits
Author SHA1 Message Date
Brues 855d4109c0 C_Spell.*: accept spellIdentifier (number / link / name)
Propagates Spell::Arg::ResolveSpellID through every C_Spell.*
table-namespace endpoint that previously accepted only a number:

  C_Spell.GetSpellInfo
  C_Spell.GetSpellName
  C_Spell.GetSpellTexture
  C_Spell.GetSpellLink
  C_Spell.GetSpellDescription
  C_Spell.IsSpellPassive
  C_Spell.IsSpellHarmful
  C_Spell.IsSpellHelpful
  C_Spell.IsSpellUsable

All three identifier forms now work uniformly across the namespace:
spellID number, |Hspell:N|h hyperlink (`GetSpellLink` round-trips
cleanly back into any of these), and known-spellbook spell name
(rank-suffix tolerant via the engine's FUN_004B3950 parser).

Behavior change: invalid input no longer raises a Lua usage error.
Modern WoW C_Spell.* convention is permissive (return nil for
unknown/garbage input, no error), so calls like
C_Spell.GetSpellName("not a spell") or C_Spell.GetSpellName(nil)
now silently return nil. Matches the existing C_Item.* convention.

Legacy globals (GetSpellInfo, IsPassiveSpell, IsHarmfulSpell,
IsUsableSpell) are unchanged — they keep their (slot, bookType)
overload via the existing ResolveLuaArgsToSpellID path. Only the
C_Spell.* table-namespace surface is broadened.
2026-05-21 14:12:06 -05:00
Brues 90a580d75d Add Game::Lua::PushBool helper, sweep condition ? 1 : 0 patterns
PushBool(L, bool) wraps lua_pushboolean and centralizes the bool→int
conversion the engine ABI requires. All ~50 sites doing
`PushBoolean(L, condition ? 1 : 0)` collapse to `PushBool(L, condition)`.
Non-PushBoolean callers passing bool→int (Fire_*, FireGetItemInfoReceived,
etc.) switched to `static_cast<int>(...)`. NameCache settings file output
relies on the default ostream bool→"0"/"1" formatting.

Literal `PushBoolean(L, 0)` / `PushBoolean(L, 1)` left alone — they're
already explicit int values.
2026-05-16 21:39:46 -05:00
Brues ee84019c85 IsHarmfulSpell(spell) / IsHelpfulSpell(spell) 2026-05-15 00:09:33 -05:00
Brues 3262f6c70e IsSpellKnown(spellID, [isPet]) 2026-05-08 17:12:22 -05:00
Brues e6095f62d3 IsPlayerSpell(spellID) 2026-05-08 14:17:38 -05:00
Brues f7d3b8bd64 IsPassiveSpell / C_Spell.IsSpellPassive 2026-05-08 12:33:29 -05:00
Brues 473681416e GetSpellLink(spellID) / C_Spell.GetSpellLink(spellID) 2026-05-08 00:36:54 -05:00
Brues 2b9a164bd1 FindSpellBookSlotByID(spellID) 2026-05-08 00:27:52 -05:00
Brues 9d0c19cf22 C_Spell.GetSpellName(spellID) and C_Spell.GetSpellTexture(spellID) 2026-05-07 23:11:31 -05:00
Brues 81924e5c95 GetSpellInfo (with (slot, bookType) overload), C_Spell.GetSpellInfo 2026-05-07 23:06:37 -05:00
Brues e580bed5f8 restructure how module register themselves 2026-05-07 20:20:35 -05:00
Brues 17a64d5bbb restructure project 2026-05-07 13:36:45 -05:00