Page 1 of 1

[fixed] Bad parameters and CTD.

PostPosted: 18 Dec 2022, 23:30
by etphonehome
Hi

I'm using lstest version.
bad parameters
get_card_instance(1, -1)
0: 0x026C1069
1: 0x026B2B43
2: 0x02679F22
3: 0x0230709B
4: 0x023C9785
5: 0x026F0F15
6: 0x026CAFCC
7: 0x026CBB76
8: 0x026CCBE0
9: 0x004722C8
10: 0x00477B2C
11: 0x026AE223
12: 0x0043BFAA
13: 0x004399BD
14: 0x0047902C
15: 0x004946E9
16: 0x761C7BA9
17: 0x77DCBB9B
18: 0x77DCBB1F
A bug!

THX

Re: Bad parameters and CTD.

PostPosted: 20 Dec 2022, 14:40
by Aswan jaguar
I tried your savegame 4 times and no error or crash for me.

Re: Bad parameters and CTD.

PostPosted: 20 Dec 2022, 16:41
by drool66
It looks like the -1 card param is from can_legally_play_iid(). The output of add_card_to_hand() needs to be checked before it's used like:
Code: Select all
int card_added = add_card_to_hand(p, c);
if( card_added != -1 ){
...

Re: Bad parameters and CTD.

PostPosted: 21 Dec 2022, 23:45
by drool66
fixed in 1c9eb63