[fixed]Fabrication Module crashes when it triggers
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
[fixed]Fabrication Module crashes when it triggers
by Aswan jaguar » 29 Mar 2019, 18:45
Describe the Bug:
Fabrication Module crashes as soon as you activate it and have a creature or a creature with energy counters enters the battlefield.
Which card did behave improperly?
Fabrication Module
Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
Manalink dev 9917c53f version - duel
What exactly should be the correct behavior/interaction?
Are any other cards possibly affected by this bug?
I have tried a lot but either it will crash or it will trigger twice. Can you please tell me what is the problem?
My latest attempt it triggers twice:
Fabrication Module crashes as soon as you activate it and have a creature or a creature with energy counters enters the battlefield.
Which card did behave improperly?
Fabrication Module
Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
Manalink dev 9917c53f version - duel
What exactly should be the correct behavior/interaction?
Are any other cards possibly affected by this bug?
I have tried a lot but either it will crash or it will trigger twice. Can you please tell me what is the problem?
My latest attempt it triggers twice:
- Code: Select all
int card_fabrication_module(int player, int card, event_t event)
{
/*
Fabrication Module |3 0x200f458
Artifact
Whenever you get one or more |E (energy counters), put a +1/+1 counter on target creature you control.
|4, |T: You get |E.
*/
enable_xtrigger_flags |= XTRIGGER_COUNTER_ENERGY;
if( xtrigger_condition() == XTRIGGER_COUNTER_ENERGY && affect_me(player, card) && trigger_cause_controller == player &&
! is_humiliated(player, card))
{
if (event == EVENT_TRIGGER){
event_result |= RESOLVE_TRIGGER_MANDATORY;
}
if (event == EVENT_RESOLVE_TRIGGER){
target_definition_t td;
default_target_definition(player, card, &td, TYPE_CREATURE);
td.allowed_controller = td.preferred_controller = player;
td.allow_cancel = 0;
card_instance_t *instance = get_card_instance( player, card );
if( can_target(&td) && new_pick_target(&td, "TARGET_CREATURE_YOU_CONTROL", 0, 0){
add_1_1_counter(instance->targets[0].player, instance->targets[0].card);
}
instance->number_of_targets = 0;
}
}
if( event == EVENT_RESOLVE_ACTIVATION ){
add_energy(player, 1);
}
return generic_activated_ability(player, card, event, GAA_UNTAPPED, MANACOST_X(4), 0, NULL, NULL);
}
Last edited by Aswan jaguar on 31 Mar 2019, 11:03, edited 1 time in total.
Reason: fixed
Reason: fixed
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8129
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 477 times
Re: Fabrication Module crashes when it triggers
by Korath » 31 Mar 2019, 00:16
That shouldn't even compile; you've misbalanced parentheses on the line with new_pick_target().
I don't know why it would crash. It doesn't for me, once the missing close-paren is added. The reason the trigger happens twice is because it doesn't check reason_for_trigger_controller.
(Also, there's no such internationalization "TARGET_CREATURE_YOU_CONTROL", unless you've added it since our server broke. You want "ASHNODS_BATTLEGEAR".)
I don't know why it would crash. It doesn't for me, once the missing close-paren is added. The reason the trigger happens twice is because it doesn't check reason_for_trigger_controller.
(Also, there's no such internationalization "TARGET_CREATURE_YOU_CONTROL", unless you've added it since our server broke. You want "ASHNODS_BATTLEGEAR".)
-
Korath - DEVELOPER
- Posts: 3708
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1108 times
Re: Fabrication Module crashes when it triggers
by Aswan jaguar » 31 Mar 2019, 10:29
I guess I have posted this and then fixed the parentheses issue between so many tries and testing.Korath wrote:That shouldn't even compile; you've misbalanced parentheses on the line with new_pick_target().
Well, I have added this before the server issue in commit 73231e99c. And few others later as I was correcting such bugs.Korath wrote:(Also, there's no such internationalization "TARGET_CREATURE_YOU_CONTROL", unless you've added it since our server broke. You want "ASHNODS_BATTLEGEAR".)
Edit: Fixed in commit 7fd24c9a.
Last edited by Aswan jaguar on 31 Mar 2019, 11:02, edited 1 time in total.
Reason: edit
Reason: edit
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8129
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 477 times
Re: [fixed]Fabrication Module crashes when it triggers
by Korath » 20 Jul 2019, 14:12
Trigger order is now always picked by the AI, instead of the Module's controller. Not that there are all that many "Whenever you get an energy counter" triggers so as to need ordering, but still.
-
Korath - DEVELOPER
- Posts: 3708
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1108 times
Re: [fixed]Fabrication Module crashes when it triggers
by Aswan jaguar » 21 Jul 2019, 08:02
Fixed in commit ad30427a.
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8129
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 477 times
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 28 guests