Page 1 of 1

[fixed]Ferrovore wrong prompt menu

PostPosted: 17 Jul 2018, 12:59
by Aswan jaguar
Describe the Bug:
Ferrovore's prompt menu wrongly says "Select a card."

Which card did behave improperly?
Ferrovore

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?
Ferrovore's prompt menu is "Select an artifact." or "Select an artifact to sacrifice."

Are any other cards possibly affected by this bug?
-

Re: Ferrovore wrong prompt menu

PostPosted: 13 Jan 2019, 16:47
by Aswan jaguar
Fixed wrong sacrifice menu and fixed the stack legacy problem in commit 4368a8e.
I tested and AI seems not broken this time.

Re: [fixed]Ferrovore wrong prompt menu

PostPosted: 18 Jan 2019, 03:59
by Korath
You made it illegal to sacrifice Ferrovore to itself, assuming of course that it's become an artifact from another effect. The previous test_definition_t set not_me specifically so that the AI wouldn't assume it could pump itself an extra +3/+0 by saccing it to itself.

Why not fix generic_activated_ability_with_sacrifice_as_cost() so it uses new_sacrifice()'s already-existing implementation to generate the prompt, rather than fixing it on every single card that calls it? All you're doing is making more work for yourself and creating new opportunities for typos (as you did with Ragamuffyn, for example).

Re: [fixed]Ferrovore wrong prompt menu

PostPosted: 18 Jan 2019, 17:18
by Aswan jaguar
Thanks, for keeping an eye on things.
- Ok, I reverted Ferrovore back "to sacrifice Ferrovore to itself" implementation in commit 14d1a2c2.
- I can't find new_sacrifice function unless you mean new_sacrifice_impl which I tried to follow with no success.
- For Ragamuffyn if you mean the "int card_Raggamuffyn" typo, that was there already and frustrated me when I was looking for the card. I don't understand how to fix that. I also met 3-4 other cards with bugs like that with "s" in the end added or missing.

Re: Ferrovore wrong prompt menu

PostPosted: 25 Jan 2019, 20:36
by Korath
No, I meant the typo in the prompt you added.

For misspelled function names, you can fix these by grepping for the function name (possibly prepended by an underscore) and changing it everywhere it appears:
Code: Select all
...\manalink\master\src>git grep -wnH _?card_raggamuffyn
git grep -wnH _?card_raggamuffyn
ManalinkEh.asm:4819:extern _card_raggamuffyn
ManalinkEh.asm:16634:  jmp near _card_raggamuffyn     ; 2006e07
cards/dissension.c:3168:int card_raggamuffyn(int player, int card, event_t event){
(You should also grep for whether the function name you intend to change it to doesn't already appear somewhere.)

I've mostly never bothered to correct such errors, since doing so still isn't always enough to find a card's implementation. Some examples, just off the top of my head:
  • There's no guarantee that, just because there's a function named card_allied_reinforcements, that Allied Reinforcements uses it instead of, say, card_ayli_eternal_pilgrim().
  • It does no good to search for card_prodigal_pyromancer when it actually reuses card_prodigal_sorcerer() (as do six other cards).
  • If a card gets functional errata (like Ajani's Pridemate just did) or exhibits a bug, and another card shares its function but needs not to change, then just fixing card_ajanis_pridemate breaks the other card. (As it happens, it was made to be the same as Bloodbond Vampire instead of different from it, but it could've just as easily gone the other way.)
You've got to trace the card back through ct_all.csv and ManalinkEh.asm and look for duplicates at each step, every time.

Re: [fixed]Ferrovore wrong prompt menu

PostPosted: 27 Aug 2019, 15:01
by Aswan jaguar
Korath wrote:Why not fix generic_activated_ability_with_sacrifice_as_cost() so it uses new_sacrifice()'s already-existing implementation to generate the prompt, rather than fixing it on every single card that calls it? All you're doing is making more work for yourself and creating new opportunities for typos (as you did with Ragamuffyn, for example).
I don't know how change the ~140 entries automatically (if that is possible) to lose the char prompt value which errors in each entry, so I prefer to change only the ones I meet that need a correct prompt.
Ferrovore fixed in commit ef267b93.