Commit 11f110f7 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #617 from sidschingis/master

fixed sometimes referencing nil values
parents e20007e6 4138a2af
......@@ -61,7 +61,7 @@ end
function c14745409.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and c:CheckUniqueOnField(tp) then
if c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and c:CheckUniqueOnField(tp) then
Duel.Equip(tp,c,tc)
end
end
......
......@@ -54,7 +54,7 @@ function c53347303.discon(e,tp,eg,ep,ev,re,r,rp)
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local loc,tg=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TARGET_CARDS)
if not tg:IsContains(c) then return false end
if not tg or not tg:IsContains(c) then return false end
if (not Duel.IsChainNegatable(ev)) or loc==LOCATION_DECK then return false end
return true
end
......
......@@ -32,7 +32,7 @@ function c58607704.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c58607704.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:GetFirst():IsRelateToEffect(e) then
if g and g:GetFirst():IsRelateToEffect(e) then
Duel.ChangeTargetCard(ev,g)
end
end
......@@ -14,7 +14,7 @@ function c62107612.initial_effect(c)
c:RegisterEffect(e1)
end
function c62107612.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and re:GetHandler():GetCode()==93717133
return bit.band(r,REASON_EFFECT)~=0 and re and re:GetHandler():GetCode()==93717133
end
function c62107612.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,62107612)==0 and e:GetHandler():IsAbleToGraveAsCost() end
......
......@@ -38,7 +38,7 @@ end
function c73544866.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsType(TYPE_EFFECT) and bc:IsStatus(STATUS_BATTLE_DESTROYED) then
if bc and bc:IsType(TYPE_EFFECT) and bc:IsStatus(STATUS_BATTLE_DESTROYED) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment