Repository navigation
Fix "Batteryman Fuel Cell" nil check - #1281
Conversation
|
This is not the correct fix for this type of problem. The general The correct approach here would be to check if there is a target that is not among the equip group of the card that is about to be used as the cost (because tributing that card will also cause the equip card(s) to leave the field). Unfortunately, that only works for interactions with equip cards, but it fails in other scenarios, such as cards that have effects like "Destroy this card when that target/it leaves the field" (where "that target/it" = the card that is going to be used as cost.) |
|
Thank you for the review, that makes sense. I can address this by changing the activation check instead, do you want me to keep the if so that the script doesn't crash in the cases that aren't covered by the equip check? |
118098b to
dc441e0
Compare
|
@NaimSantos I changed the approach, following https://github.com/ProjectIgnis/CardScripts/blob/dc441e0473596531c86820619bacc39f10b2a6f8/official/c68508433.lua (Spirit Tech Force - Pendulum Ruler) which has a similar idea (tribute, then destroy) return c:IsSetCard(SET_BATTERYMAN) and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,c:GetEquipGroup()+c)A batteryman, and a card that can be targeted by the effect, on the field, excluding the equipped cards of that batteryman (as they would be destroyed when tributing) |
d417ff9 to
e30e451
Compare
This PR addresses an error that happens with Batteryman Fuel Cell:
attempt to index a nil value (local 'tc')The way to reproduce is:
tcisnil), and you get the error I mentioned above