Skip to content

Commit c0dbc2e

Browse files
committed
"De-Spell (Rush)" update
Prevent script erros if the opponent does not have a S/T card when it resolves
1 parent 29c05f2 commit c0dbc2e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

rush/c160016060.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ function s.initial_effect(c)
66
--Reveal 1 set card in opponent's S/T zones
77
local e1=Effect.CreateEffect(c)
88
e1:SetDescription(aux.Stringid(id,0))
9-
e1:SetType(EFFECT_TYPE_ACTIVATE)
109
e1:SetCategory(CATEGORY_DESTROY)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
1111
e1:SetCode(EVENT_FREE_CHAIN)
1212
e1:SetTarget(s.target)
1313
e1:SetOperation(s.activate)
@@ -23,8 +23,10 @@ end
2323
function s.activate(e,tp,eg,ep,ev,re,r,rp)
2424
--Effect
2525
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
26-
local g=Duel.SelectMatchingCard(tp,s.filter,tp,0,LOCATION_SZONE,1,1,nil)
27-
Duel.HintSelection(g,true)
28-
if g:GetFirst():IsFacedown() then Duel.ConfirmCards(tp,g) end
29-
if g:GetFirst():IsSpell() then Duel.Destroy(g,REASON_EFFECT) end
26+
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,0,LOCATION_SZONE,1,1,nil):GetFirst()
27+
if tc then
28+
Duel.HintSelection(tc)
29+
if tc:IsFacedown() then Duel.ConfirmCards(tp,tc) end
30+
if tc:IsSpell() then Duel.Destroy(tc,REASON_EFFECT) end
31+
end
3032
end

0 commit comments

Comments
 (0)