Skip to content

Commit 9086a12

Browse files
mrbudsemptyrivers
authored andcommitted
Fix integer overflow error with SpellKnow checks
1 parent 79067a2 commit 9086a12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

WeakAuras/Prototypes.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ end
10921092
---@param spell string|number
10931093
---@return boolean result
10941094
function WeakAuras.IsPlayerSpellOrOverridesAndBaseIsPlayerSpell(spell)
1095-
if spell == 0 then return false end
1095+
if spell == 0 or spell >= 2^31 then return false end
10961096
if IsPlayerSpell(spell) then
10971097
return true
10981098
end
@@ -1107,7 +1107,7 @@ end
11071107

11081108
---@private
11091109
function WeakAuras.IsSpellKnownForLoad(spell, exact)
1110-
if spell == 0 then return false end
1110+
if spell == 0 or spell >= 2^31 then return false end
11111111
local result = IsPlayerSpell(spell)
11121112
or IsSpellKnownOrOverridesAndBaseIsKnown(spell, false)
11131113
or IsSpellKnownOrOverridesAndBaseIsKnown(spell, true)
@@ -1128,7 +1128,7 @@ end
11281128
---@param pet boolean?
11291129
---@return boolean result
11301130
function WeakAuras.IsSpellKnown(spell, pet)
1131-
if spell == 0 then return false end
1131+
if spell == 0 or spell >= 2^31 then return false end
11321132
if (pet) then
11331133
return IsSpellKnownOrOverridesAndBaseIsKnown(spell, true)
11341134
end

0 commit comments

Comments
 (0)