Page 1 of 1

Cautery Sliver prevent damage to opponent or AI use crash

PostPosted: 21 Apr 2023, 12:36
by Aswan jaguar
Describe the Bug:
If I use Cautery Sliver's ability to prevent damage from Opponent it crashes. No issue if you target anything else. The same things probably happens when AI uses it to prevent damage. It produces the following error: (first 3 lines only) as the rest wont be the same for you.
Code: Select all
Assertion failed
functions/functions.c:2120
card_added != -1
It seems that cards that uses prevent_the_next_n_damage() and target opponent through a legacy like in this case have this issue. As I have coded one more such card Sunfire Balm and has the same problems when you activate cycle ability for human and crashes immediately in AI's turn if AI has mana to cycle it.
Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
dev based on commit 461623e ("Fix Pygmy Hippo legacy doesn't ever resolve trigger", 2023-04-20)/ duel

What exactly should be the correct behavior/interaction?
No crash when Human uses it to target opponent or when AI uses it.

Are any other cards possibly affected by this bug?
-

Re: Cautery Sliver prevent damage to opponent or AI use cras

PostPosted: 09 Mar 2024, 14:13
by Aswan jaguar
Possibly commit: 167e8c7 ("Treefolk Healer and Serra's Hymn can prevent damage made to opponent", 2024-03-09) is relevant to this issue. See comments on Serra's Hymn code in source.
EDIT: The issue happens as the parent card is not there when the activated ability resolves as it has been already sacrificed for Cautery Sliver or has been discarded for Sunfire Balm.