Skip to content

Commit

Permalink
Avoid calling IsIllusion on enemies (#136)
Browse files Browse the repository at this point in the history
It is invalid to call IsIllusion on enemies and will always return nil.
  • Loading branch information
JoshdanG authored Sep 12, 2023
1 parent 017f23c commit 6900c96
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions util/MiraDota.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1659,9 +1659,6 @@ function ItemFun.GetItemShortName(t)
end

function Hero.MustBeIllusion(target)
if target:IsIllusion() then
return true
end
if GetTeam() == target:GetTeam() then
return target:IsIllusion()
end
Expand Down
2 changes: 1 addition & 1 deletion utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ end

function utilityModule.UCanCast(npcEnemy) --magic immune
return npcEnemy:CanBeSeen() and not npcEnemy:IsInvulnerable() and not utilityModule.HasImmuneDebuff(npcEnemy) and
not npcEnemy:IsIllusion()
not AbilityExtension:MustBeIllusion(GetBot(), npcEnemy)
end

function utilityModule.CanCastNoTarget()
Expand Down

0 comments on commit 6900c96

Please sign in to comment.