It is currently 08 Jul 2021, 00:17
   
Text Size

[fixed/closed]Malfegor

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

[fixed/closed]Malfegor

Postby drool66 » 02 Aug 2013, 07:35

Describe the Bug:
Malfegor's discard ability forces you to discard even with no cards in hand

Which card did behave improperly ?
Malfegor

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

What exactly should be the correct behavior/interaction ?
You should discard until you have no cards in hand and the game should continue

Are any other cards possibly affected by this bug ?
If that part of the code was copypasted, then most likely.
Last edited by BAgate on 16 Jan 2014, 11:28, edited 4 times in total.
Reason: closed
User avatar
drool66
 
Posts: 612
Joined: 25 Nov 2010, 22:38
Has thanked: 149 times
Been thanked: 137 times

Re: Malfegor

Postby Gargaroz » 02 Aug 2013, 13:01

Usually, this kind of bug is linked to another card that wrongly alter the "hand_count[]" array. The code for Malfegor and "discard_all()" function seems fine. Try to reproduce the bug and keep track of the cards you played.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7095
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 593 times

Re: [more info needed]Malfegor

Postby drool66 » 11 Aug 2013, 07:36

Same issue seems to come up. I've put it into play with Kaalia. Maybe it still "sees" itself in my hand since it wasn't cast?
Attachments
Malfegor 2.zip
(4.6 KiB) Downloaded 80 times
User avatar
drool66
 
Posts: 612
Joined: 25 Nov 2010, 22:38
Has thanked: 149 times
Been thanked: 137 times

Re: [more info needed]Malfegor

Postby Korath » 11 Aug 2013, 08:08

discard() checks for (instance->internal_card_id != -1 && !(instance->state & (STATE_INVISIBLE|STATE_IN_PLAY))) to see whether the random card it picked (from 0 to active_card_count[player]-1) is actually in player's hand. It might be feasible to add a debug option set in config.txt to do a manual count and compare that to hand_count[] periodically (every turn, every phase change, every time rules_engine() gets called) and pop up an error message if they differ.

Or we could make the rules engine card pop up each player's hand_count whenever you click on it, which might help track this and similar problems down.
User avatar
Korath
DEVELOPER
 
Posts: 3522
Joined: 02 Jun 2013, 05:57
Has thanked: 491 times
Been thanked: 1037 times

Re: [more info needed]Malfegor

Postby Gargaroz » 11 Aug 2013, 12:19

Drool66, post you decklist here, I'll check the card codes.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
Gargaroz
Programmer
 
Posts: 7095
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 593 times

Re: [more info needed]Malfegor

Postby drool66 » 11 Aug 2013, 19:45

Cool, thank you, Garagoz!
Attachments
Kaalia's Minions.zip
(1.43 KiB) Downloaded 77 times
User avatar
drool66
 
Posts: 612
Joined: 25 Nov 2010, 22:38
Has thanked: 149 times
Been thanked: 137 times

Re: [more info needed]Malfegor

Postby BAgate » 01 Dec 2013, 20:55

Korath, you did some similar work on a jace's archivist bug (http://www.slightlymagic.net/forum/viewtopic.php?f=110&t=11003&p=131399&hilit=jace#p131399). Are you still working on this, or do we consider it fixed?
Working on: housekeeping and archived reports
User avatar
BAgate
Tester
 
Posts: 2445
Joined: 06 Mar 2012, 11:09
Has thanked: 117 times
Been thanked: 158 times

Re: [more info needed]Malfegor

Postby Korath » 02 Dec 2013, 17:53

At some point we moved nearly all the direct manipulation of hand_count[] into wrappers for the four or five functions that talk directly to the exe, instead of in the many hundreds of functions that call them (the change was committed on Sun Oct 13, so I think that makes PtT the first released patch with it); so hand_count errors should be much, much rarer now.

On the other hand, discard() could stand a bit of code to make sure there's at least one card in hand if it gets called anyway. While most things calling it from the exe check that themselves, not all do, so it wouldn't be sufficient just write it a front end for calls from C.

On yet a third hand, Malfegor itself calls discard_all() instead of discard() directly, so yes, it'll get caught by the safeguard I added for Jace's Archivist.
User avatar
Korath
DEVELOPER
 
Posts: 3522
Joined: 02 Jun 2013, 05:57
Has thanked: 491 times
Been thanked: 1037 times


Return to Archived Reports

Who is online

Users browsing this forum: Bing [Bot] and 4 guests


Who is online

In total there are 5 users online :: 1 registered, 0 hidden and 4 guests (based on users active over the past 10 minutes)
Most users ever online was 1922 on 07 Jun 2021, 06:01

Users browsing this forum: Bing [Bot] and 4 guests

Login Form