It is currently 12 May 2025, 11:12
   
Text Size

[fixed /closed]Scab-Clan Giant

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

[fixed /closed]Scab-Clan Giant

Postby stassy » 04 Sep 2013, 10:25

Describe the Bug:
Scab-Clan Giant generate an error window when entering the bf and if opponent has more than one creature in bf

Which card did behave improperly ?
Scab-Clan Giant

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
OIv2

What exactly should be the correct behavior/interaction ?
Scab-Clan Giant does not generate an error window when entering the bf and if opponent has more than one creature in bf

Are any other cards possibly affected by this bug ?
-

This seems to no affect the game at all but corrupt savegame but this is an unusual error with trashed registers mention (I think I got on of those long long time ago)

Image

Image
Last edited by Aswan jaguar on 29 Dec 2013, 08:30, edited 2 times in total.
Reason: fixed/closed
stassy
Moderator
 
Posts: 5274
Joined: 25 Feb 2009, 07:06
Has thanked: 471 times
Been thanked: 337 times

Re: Scab-Clan Giant

Postby Aswan jaguar » 04 Sep 2013, 14:15

I got one couple of days ago,for the first time after 3 years.But I don't remember more(probably AI turn - beginning the game for sure)
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8129
Joined: 13 May 2010, 12:17
Has thanked: 748 times
Been thanked: 477 times

Re: Scab-Clan Giant

Postby Korath » 04 Sep 2013, 16:23

Aswan Jaguar, your popup's unrelated. It's for an EVENT_ABILITIES (0x34) call to RukhEggFx (0x00457e10); that's the legacy card that got rewritten so it calls arbitrary code, so it'll be essentially impossible to debug unless you can find some way to reliably trigger the popup, much the same way the "Wrong parameter at address:" popups are when they only give the address of the C wrapper for get_card_instance.

As for Scab-Clan Giant, I'm not sure. That popup is generated when a card's function changes the ebp, ebx, esi, or edi registers; these are all callee-saved, so if gcc generates code that uses them, it'll save their previous values at the start of the function it's compiling and restore them at the end. And, indeed, that's what it does for card_scab_clan_giant() in the OtIv2 version of manalinkeh.dll - so even if it one of the other functions it calls trashed the registers, they should still have been properly restored.

I'm a little tempted to change call_cards_function(), which 99% of the calls to individual cards go through and is the only function that pops up this error, so that it saves and restores ebx/esi/edi itself instead of just checking to see if they weren't properly preserved. Problem is, if a card function genuinely doesn't clean up one of these registers, it'll cause random errors in the 1% of calls that don't go through call_cards_function().
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times

Re: Scab-Clan Giant

Postby Korath » 04 Sep 2013, 16:51

Never mind, I see why - you can't do "int cr_array[] = { 0 };" - that just allocates an array of length 1, with cr_array[0] initialized to 0. When you then try to store a second creature at cr_array[1], it overwrites the previous data on the stack; that happens to be one of the saved registers, so it gets restored wrong. Try int cr_array[500] (and there's no need to initialize it, since cr_count keeps track of the last-used index).

Also, Scab-Clan Giant doesn't do anything if opponent controls exactly one creature; that's because trg is left at 0 instead of being assigned to cr_array[0].

Gargaroz, I'll install both these fixes when you send me the code. (edit:done)

(I haven't fixed the part where it's supposed to target the random creature, so can't pick shrouded/hexproof/protection-from-red creatures, nor scare a Skulking Ghost into the graveyard before the effect resolves.)
User avatar
Korath
DEVELOPER
 
Posts: 3708
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1108 times


Return to Archived Reports

Who is online

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


Who is online

In total there are 22 users online :: 1 registered, 0 hidden and 21 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 21 guests

Login Form