Stop heal prediction erroring on vanilla clients with ClassicAPI
libpredict registered the tbc spellcast and combat log events on every client and relied on vanilla never firing them. A vanilla client with an API backport such as ClassicAPI fires UNIT_SPELLCAST_START as well, without UnitCastingInfo, so every cast raised "attempt to call global 'UnitCastingInfo'". Register those events on the tbc client only; vanilla keeps using its own SPELLCAST events.
This commit is contained in:
+10
-7
@@ -338,13 +338,16 @@ libpredict.sender.SendResCommMsg = function(self, msg)
|
||||
SendAddonMessage("CTRA", msg, "BATTLEGROUND")
|
||||
end
|
||||
|
||||
-- tbc
|
||||
libpredict.sender:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_START")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_STOP")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_FAILED")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_SENT")
|
||||
-- tbc (a vanilla client with an API backport such as ClassicAPI fires these
|
||||
-- too, next to the vanilla events, without UnitCastingInfo: only tbc listens)
|
||||
if GetExpansion() ~= "vanilla" then
|
||||
libpredict.sender:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_START")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_STOP")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_FAILED")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
|
||||
libpredict.sender:RegisterEvent("UNIT_SPELLCAST_SENT")
|
||||
end
|
||||
|
||||
-- vanilla
|
||||
libpredict.sender:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF")
|
||||
|
||||
Reference in New Issue
Block a user