It is currently 24 Apr 2024, 09:34
   
Text Size

[confirmed]Moonlit Strider bad parameter & crash to desktop.

Report wrong Card behavior to get it fixed.
PLEASE ADD SAVEGAMES TO YOUR TOPIC !

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

[confirmed]Moonlit Strider bad parameter & crash to desktop.

Postby etphonehome » 06 Oct 2021, 17:45

Another bad parameter alert and crash to desktop.

THX
Attachments
AUTOSAVE.rar
(1.93 KiB) Downloaded 163 times
dump.rar
(225 Bytes) Downloaded 160 times
Captura de ecrã 2021-10-06 184124.jpg
Last edited by Aswan jaguar on 10 Oct 2021, 07:25, edited 4 times in total.
Reason: confirmed
etphonehome
 
Posts: 299
Joined: 21 May 2020, 12:50
Has thanked: 270 times
Been thanked: 39 times

Re: Another bad parameter alert and crash to desktop.

Postby Aswan jaguar » 07 Oct 2021, 13:36

AI doesn't like something in Moonlit Strider code, and it is not that it doesn't validate it's target. If there is another creature in AI's battlefield and AI has in hand Moonlit Strider and tries to cast it, crash.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: [confirmed]Another bad parameter alert and crash to desk

Postby Korath » 07 Oct 2021, 17:01

The dump file in the attached rar isn't anything like the one in your screenshot.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [confirmed]Another bad parameter alert and crash to desk

Postby etphonehome » 07 Oct 2021, 17:55

After this alert i think it gave another alert and crashed.
etphonehome
 
Posts: 299
Joined: 21 May 2020, 12:50
Has thanked: 270 times
Been thanked: 39 times

Re: [confirmed]Another bad parameter alert and crash to desk

Postby drool66 » 07 Oct 2021, 18:01

It's my fault -
markup of is_this_dying(): "this should be checked only during EVENT_GRAVEYARD_FROM_PLAY to be realiable"
me: checks it during TRIGGER_LEAVE_PLAY

EDIT: Oh, ok. Moonlit Strider's EVENT_RESOLVE_ACTIVATION tries to pump ability using the parent as the source... on an ability that sacrifices the parent. That will give you a bad param. Fixed
User avatar
drool66
Programmer
 
Posts: 1163
Joined: 25 Nov 2010, 22:38
Has thanked: 186 times
Been thanked: 267 times

Re: [fixed]Another bad parameter alert and crash to desktop.

Postby Aswan jaguar » 07 Oct 2021, 20:12

For me with below code if you didn't change anything else it dumps and crashes.
error | Open
bad parameters
get_card_instance(24254622, 24254622)
0: 0x025B2218
1: 0x025B8CCE
2: 0x025C91EB
3: 0x0043467C
4: 0x0043C147
5: 0x004399BD
6: 0x0047902C
7: 0x004946E9
8: 0x7C80B729

Code: Select all
int card_moonlit_strider(int player, int card, event_t event){
   /* CARD_ID_MOONLIT_STRIDER   7521
   Moonlit Strider   |3|W
   Creature - Spirit 1/4
   Sacrifice ~: Target creature you control gains protection from the color of your choice until end of turn.
   Soulshift 3 (When this creature dies, you may return target Spirit card with converted mana cost 3 or less from your graveyard to your hand.)*/

   if( ! IS_GAA_EVENT(event) ){
      return soulshift(player, card, event, 3, 1);
   }

   target_definition_t td;
   default_target_definition(player, card, &td, TYPE_CREATURE );
   td.preferred_controller = td.allowed_controller = player;

   card_instance_t *instance = get_card_instance( player, card );

   if( event == EVENT_CAN_ACTIVATE || event == EVENT_ACTIVATE ){
      return generic_activated_ability(player, card, event, GAA_CAN_TARGET | GAA_SACRIFICE_ME | GAA_LITERAL_PROMPT, MANACOST0, 0,
                              &td, "Select target creature you control.");
   }

   if( event == EVENT_RESOLVE_ACTIVATION ){
      if( valid_target(&td) ){
         pump_ability_until_eot(player, card, instance->targets[0].player, instance->targets[0].card,
                           0, 0, select_a_protection(player) | KEYWORD_RECALC_SET_COLOR, 0);
      }
   }

   return 0;
}
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: [fixed]Another bad parameter alert and crash to desktop.

Postby drool66 » 07 Oct 2021, 20:37

You also have to make a change in leaves_play() - that's the part that's my fault. Try moving the lines:
Code: Select all
         if( is_this_dying(player, card) && check_for_death_trigger_removal(player, card) && can_be_suppressed )
            return 0;
under the "if" just below it ( if affect_me()... ) , right above "if( event == EVENT_TRIGGER )" Doing this seems to shield it from bad params by checking affect_me() and trigger_cause/_controller before getting an instance from them. I can play a game with two Moonlit Strider s on the bf and one in AI's hand with no crashes or dumps.
User avatar
drool66
Programmer
 
Posts: 1163
Joined: 25 Nov 2010, 22:38
Has thanked: 186 times
Been thanked: 267 times

Re: [fixed]Another bad parameter alert and crash to desktop.

Postby Korath » 07 Oct 2021, 21:01

Pretty sure the root problem here is that you can reactivate the strider an arbitrary number of times in response to its own soulshift trigger.

Why are you always triggering on TRIGGER_LEAVE_PLAY in legacy_effect_pump_ability_until_eot(), anyway, instead of just when the effect's configured to do something when the source or affected object leaves the bf?
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [fixed]Another bad parameter alert and crash to desktop.

Postby drool66 » 08 Oct 2021, 00:11

Why are you always triggering on TRIGGER_LEAVE_PLAY in legacy_effect_pump_ability_until_eot(), anyway, instead of just when the effect's configured to do something when the source or affected object leaves the bf?
Do you mean instead of this:
Code: Select all
   leaves_play(instance->targets[6].player, instance->targets[6].card, event, 0, 0);
   if( event == EVENT_LEAVES_PLAY_ABILITY && ((instance->targets[3].player & PAUE_END_IF_SOURCE_UNTAP ) || (instance->targets[3].player & PAUE_END_IF_SOURCE_LEAVES_PLAY ))){
      end_effect = 1;
   }
Something like this?:
Code: Select all
   if( ((instance->targets[3].player & PAUE_END_IF_SOURCE_UNTAP ) || (instance->targets[3].player & PAUE_END_IF_SOURCE_LEAVES_PLAY )) ){
      leaves_play(instance->targets[6].player, instance->targets[6].card, event, 0, 0);
      if( event == EVENT_LEAVES_PLAY_ABILITY ){
         end_effect = 1;
      }
   }
That makes sense
User avatar
drool66
Programmer
 
Posts: 1163
Joined: 25 Nov 2010, 22:38
Has thanked: 186 times
Been thanked: 267 times

Re: [confirmed]Moonlit Strider bad parameter & crash to desk

Postby Aswan jaguar » 03 Apr 2022, 17:46

Any news on this?
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: [confirmed]Moonlit Strider bad parameter & crash to desk

Postby drool66 » 04 Apr 2022, 02:55

I'll commit the changes to legacy_effect_pump_ability_until_eot() soon. The others snuck in under my nose in d693305. I believe it's fixed.
User avatar
drool66
Programmer
 
Posts: 1163
Joined: 25 Nov 2010, 22:38
Has thanked: 186 times
Been thanked: 267 times


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 22 guests

cron

Who is online

In total there are 22 users online :: 0 registered, 0 hidden and 22 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 22 guests

Login Form