Skip to content

Commit 5d126d6

Browse files
authored
Fix "Emperor's Armor"
Prevent script errors from situations where there is no opponent's monster to battle.
1 parent fad6cf7 commit 5d126d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

unofficial/c511000697.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ function s.initial_effect(c)
2121
end
2222
function s.atkcon(e)
2323
local ec=e:GetHandler():GetEquipTarget()
24-
return ec and (Duel.GetAttacker()==ec or Duel.GetAttackTarget()==ec)
24+
local ac=Duel.GetAttacker()
25+
local dc=Duel.GetAttackTarget()
26+
return ec and ac~=nil and dc~nil and (ac==ec or dc==ec)
2527
end
2628
function s.atkval(e,c)
2729
local eq=e:GetHandler():GetEquipTarget()

0 commit comments

Comments
 (0)