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
ProjectIgnis/CardScripts#1281, merged on 2026-10-22 as 188c4b93: the cost Tributes only a Batteryman that leaves a card to target, so the effect is not offered where its cost would take away its only target, in place of the guard that let it resolve doing nothing. Played here until the pin of vendor/CardScripts holds that revision. The test that holds a mend to CardScripts' script takes runs of lines now, as this one rewrites eight lines into four. The recorded duel of seed 47410671 is offered the effect where it was before, and no longer at the 456th, 459th and 462nd answers, the last the one that activated it. Batteryman's pilot against every deck, 128 games a pairing, and the bench's games of moving the pin are the same games, digest for digest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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