It is currently 15 May 2025, 10:09
   
Text Size

[fixed] Temple Altisaur? Bad parameters

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

[fixed] Temple Altisaur? Bad parameters

Postby Wally » 14 Oct 2020, 05:07

Describe the Bug:
Bad parameters generated, last action was casting Temple Altisaur, several paramaters windows opened, play was able to continue after closing them

Which card behaved improperly?
Temple Altisaur ?

Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
version 8-2020 a62926f, duel

bad parameters
get_card_instance(0, -1)
0: 0x0253E188
1: 0x024F2B3E
2: 0x025370CE
3: 0x0254E415
4: 0x0252B97D
5: 0x0252BA27
6: 0x025333F7
7: 0x02533364
8: 0x0212809C
9: 0x0254E415
10: 0x0252B97D
11: 0x0252C4BE
12: 0x00435A13
13: 0x004770E3
14: 0x004B361F
15: 0x0043CD3D
16: 0x004399BD
17: 0x0047902C
18: 0x004946E9
19: 0x76D06359
20: 0x76EF7C24
21: 0x76EF7BF4
Attachments
AUTOSAVE.zip
(3.78 KiB) Downloaded 135 times
Last edited by drool66 on 17 Oct 2020, 16:24, edited 2 times in total.
Reason: fixed
Wally
 
Posts: 234
Joined: 05 Mar 2009, 04:39
Location: Australia
Has thanked: 2 times
Been thanked: 17 times

Re: Temple Altisaur? Bad parameters

Postby drool66 » 16 Oct 2020, 21:02

Hard to tell since the error chain appears inconsistently and the dump is unhelpful in the current dev, but it does seem to be linked to Temple Altisaur. The card uses the conventional method for these type of events, but I did add a check for affected_card_controller > -1 && affected_card > -1, plus damage->damage_target_player > -1 && damage->damage_target_card > -1; will push soon
User avatar
drool66
Programmer
 
Posts: 1185
Joined: 25 Nov 2010, 22:38
Has thanked: 187 times
Been thanked: 280 times

Re: [confirmed] Temple Altisaur? Bad parameters

Postby Korath » 16 Oct 2020, 21:31

affected_card_controller/affected_card aren't going to be a problem. (And the check that they're a damage card is redundant; EVENT_PREVENT_DAMAGE is only dispatched for those.) What's likely crashing is the has_subtype() call when the damage card is attached to a player - and, indeed, I can reliably crash by Shock'ing myself with a Temple Altisaur on the bf. Check damage->damage_target_card != -1 instead.

...You are keeping the .dbg file for your release builds, right? There isn't any point in asking people to post dumps otherwise.
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times

Re: [confirmed] Temple Altisaur? Bad parameters

Postby drool66 » 16 Oct 2020, 22:50

Yep! Figured the has_subtype() damage_target_player/card out later & edited my post. Everything seems to run smoothly now.
EDIT: Would it make sense to add a "if( card < 0 ) return 0;" to the top of has_subtype(), or do you think it would be better to leave as is so that we are more sure to code our cards better?

...You are keeping the .dbg file for your release builds, right? There isn't any point in asking people to post dumps otherwise.
Oh my gosh, that's what those are for. I had no idea. Will do.
User avatar
drool66
Programmer
 
Posts: 1185
Joined: 25 Nov 2010, 22:38
Has thanked: 187 times
Been thanked: 280 times

Re: [confirmed] Temple Altisaur? Bad parameters

Postby Korath » 17 Oct 2020, 00:50

drool66 wrote:Would it make sense to add a "if( card < 0 ) return 0;" to the top of has_subtype(), or do you think it would be better to leave as is so that we are more sure to code our cards better?
This is the sort of thing that hides bugs instead of preventing them. Think about what would've happened if that had been in place, and the next card you programmed read something like "If a source would deal damage to another non-Dinosaur you control, prevent all but 1 of that damage."

What this calls for isn't returning 0 if player or card are invalid; it's ASSERT()ing that they are.
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times

Re: [confirmed] Temple Altisaur? Bad parameters

Postby drool66 » 17 Oct 2020, 02:02

What I figured, thank you.
User avatar
drool66
Programmer
 
Posts: 1185
Joined: 25 Nov 2010, 22:38
Has thanked: 187 times
Been thanked: 280 times

Re: [fixed] Temple Altisaur? Bad parameters

Postby drool66 » 18 Oct 2020, 03:25

Committed in c323d59
User avatar
drool66
Programmer
 
Posts: 1185
Joined: 25 Nov 2010, 22:38
Has thanked: 187 times
Been thanked: 280 times


Return to Archived Reports

Who is online

Users browsing this forum: Google [Bot] and 28 guests


Who is online

In total there are 29 users online :: 1 registered, 0 hidden and 28 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: Google [Bot] and 28 guests

Login Form