Page 1 of 1

[fixed]Barter in Blood crash if a player has <2

PostPosted: 21 Nov 2017, 18:42
by Aswan jaguar
Describe the Bug:
Barter in Blood will crash the game when cast if a player controls less than 2 creatures.

Which card did behave improperly?
Barter in Blood

Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
Manalink dev 778ccb5 version - duel

What exactly should be the correct behavior/interaction?
Barter in Blood doesn't crash if a player has less than 2 creatures
5/1/2012 If a player controls only one creature, that creature is sacrificed.
5/1/2012 Barter in Blood doesn’t target any creatures and may be cast even if a player controls fewer than two creatures.
Are any other cards possibly affected by this bug?
-

Re: Barter in Blood crash if a player has <2

PostPosted: 17 Apr 2019, 16:51
by Aswan jaguar
This bug is the same for all cards that sacrifice more than 1 object for each player - it goes on a loop if objects to sacrifice less than wanted. At least these are: Destructive Force, Devastating Dreams, Ember Swallower, Tectonic Break, Thoughts of Ruin, Wildfire.
Probably Rite of Ruin which has also other bugs, see: viewtopic.php?f=86&t=14620&p=209790&hilit=rite+of+ruin#p209790.
Edit: They all use the apnap code that seems to have a problem with this.

Re: Barter in Blood crash if a player has <2

PostPosted: 24 Feb 2020, 18:27
by gnomefry
Was this <2 crash bug fixed?

I ask because I'm seeing <2 creature bug for Barter in Blood, but not a crash. When a player has only 1 creature to choose it won't be sacrificed. Meanwhile an opponent with 2 or more creatures will still lose 2 creatures of their choice.

Re: [part confirm]Barter in Blood crash if a player has <2

PostPosted: 24 Feb 2020, 19:02
by Aswan jaguar
Either the crash happens in specific scenarios or I have forgot some code when trying to fix this so it doesn't crash, anyway the most important thing is that it bugs for that scenario.

Re: [fixed]Barter in Blood crash if a player has <2

PostPosted: 25 Apr 2020, 20:51
by drool66
I'm about 99% sure fixed in fbefacbef ("Fix AI loops re: multi sacrifice", 2020-04-25)

I now get no crash in this savegame, or this one.
Was also getting an infinite loop when casting Barter in Blood when either player had exactly one creature on board, or fewer than X when casting Death Cloud - all fixed by this commit; the creature is now sacrificed as well. Also tested with Destructive Force, Devastating Dreams, Ember Swallower, Tectonic Break, Thoughts of Ruin & Wildfire, though several of these seem to have their own unrelated bugs. Destructive Force, for example, doesn't use the same function, and actually seems to use its own sacrifice function. I don't think there are other scenarios that would cause this crash, and they are not documented here, so I will mark as fixed, but feel free to overrule me.