Page 1 of 1

[fixed]Proliferate broken adds counters only to players

PostPosted: 25 Nov 2021, 14:58
by Aswan jaguar
Describe the Bug:
Proliferate is broken again in dev. It will prompt and add counters only to player.
No mater if you choose auto or hand.
And of course it still doesn't work with it's current rules see last post:
viewtopic.php?f=86&t=29514&p=242811&hilit=proliferate#p243513

Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
dev 66689d9 commit

What exactly should be the correct behavior/interaction?
Give another counter to ones already there for chosen player and permanents for manual mode. For auto make your best to choose beneficial counters for you and negative for opponent.

Are any other cards possibly affected by this bug?
-

Re: Proliferate broken adds counters only to players

PostPosted: 25 Nov 2021, 18:00
by Korath
In manual mode, at least, targeting is correct - it fails if no counters are on the selected permanent and passes if there are - but nothing happens afterwards, so apparently it's choose_existing_counter_type() that's broke. It should be bypassed for proliferate() now anyway because of the rules change, but it'll still need to be fixed for other things that call it like Hex Parasite and Leech Bonder.

Re: Proliferate broken adds counters only to players

PostPosted: 25 Nov 2021, 18:44
by Korath
It was broken in drool66's Nov 14 commit e87950a9c2, which changed choose_existing_counter_type to look at counters on src_player,src_card instead of t_player,t_card.
Code: Select all
~/src/manalink/master$ git diff e87950a9c2^! src/functions/counters.c
diff --git a/src/functions/counters.c b/src/functions/counters.c
index 9efc35145..f2a051bb2 100644
--- a/src/functions/counters.c
+++ b/src/functions/counters.c
@@ -2148,7 +2148,7 @@ counter_t choose_existing_counter_type(int who_chooses, int src_player, int src_

   int num_types = 0;

-  card_instance_t* instance = get_card_instance(t_player, t_card);
+  card_instance_t* instance = get_card_instance(src_player, src_card);
   uint8_t* t18 = (void*)(&instance->targets[18].player);

   struct
What made this change necessary?

Re: [confirm]Proliferate broken adds counters only to player

PostPosted: 26 Nov 2021, 17:29
by drool66
I see. It was for Nesting Grounds - I misunderstood the function and it seemed like a glaring error. Fixed, unpushed.

Re: [fixed]Proliferate broken adds counters only to players

PostPosted: 26 Nov 2021, 20:37
by Korath
Looking at it again years after I wrote it, I don't think it needs to be passed src_player and src_card at all. They aren't used for anything except to pass to DIALOG(), and between also passing it DLG_FULLCARD(), DLG_WHO_CHOOSES(), DLG_HEADER(), and DLG_NO_STORAGE, I think dialog_impl() won't actually use them for anything.

(Heck, I'm just happy this wasn't caused by the hack I used to put off assigning AI values to the last few sets' counter types.)

Re: [fixed]Proliferate broken adds counters only to players

PostPosted: 28 Nov 2021, 02:50
by drool66
Fixed in f7a02a4