[fixed]Avatar of Discord bad selection
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
[fixed]Avatar of Discord bad selection
by Aswan jaguar » 25 Aug 2016, 08:39
Describe the Bug:
I cast Avatar of Discord I discarded a card but then in hand (in panel to choose from not actual hand as the cards were in actual hand)there were missing 2 cards instead of the the 1 I discarded.Another time after the first card I discarded 3 were missing.This doesn't happen all the time as I cast it without a problem other times.
Which card did behave improperly ?
Avatar of Discord
Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
Manalink 2016/08/07: Eldritch Moon, duel
What exactly should be the correct behavior/interaction ?
Avatar of Discord when you discard a card only that card gets removed from hand prompt window.
Are any other cards possibly affected by this bug ?
-
I cast Avatar of Discord I discarded a card but then in hand (in panel to choose from not actual hand as the cards were in actual hand)there were missing 2 cards instead of the the 1 I discarded.Another time after the first card I discarded 3 were missing.This doesn't happen all the time as I cast it without a problem other times.
Which card did behave improperly ?
Avatar of Discord
Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
Manalink 2016/08/07: Eldritch Moon, duel
What exactly should be the correct behavior/interaction ?
Avatar of Discord when you discard a card only that card gets removed from hand prompt window.
Are any other cards possibly affected by this bug ?
-
- Attachments
-
avatar of discord discard panel after 1st pick limits.rar
- (3.31 KiB) Downloaded 252 times
Last edited by Aswan jaguar on 10 Aug 2020, 17:40, edited 4 times in total.
Reason: fixed
Reason: fixed
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8129
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 477 times
Re: [confirmed]Avatar of Discord bad selection
by BAgate » 25 Aug 2016, 09:26
To state more clearly, after you select a card to discard more than one disappear from the selection box. The correct cards are discarded.
Working on: housekeeping and archived reports
Re: [confirmed]Avatar of Discord bad selection
by Gargaroz » 19 Sep 2016, 17:28
The new implementation of 'discard_card' was a bit buggy, it was recently fixed so consider also this fixed until further notice.
----
- 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
- 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: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: [still bug]Avatar of Discord bad selection
by Aswan jaguar » 20 Apr 2018, 13:46
Still the same bug. I have some more info to help this time. It seems that the 1st card you choose to be discarded, together with the 2 cards with the biggest in game ids will be removed from the selection panel when you get to choose a 2nd card to be discarded. If there is only 1 card or none card with bigger in game id then only the 1 card will be missing or none will be missing retrospectively.
The discarded cards are correct they are ones you have chosen to discard.
The discarded cards are correct they are ones you have chosen to discard.
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8129
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 477 times
Re: [still bug]Avatar of Discord bad selection
by FastEddie » 10 Aug 2020, 16:24
Simple issue once you got the hang of it... which took me 2 hours. The counter for player's cards was decremented inside the loop shifting the hand back one card to overwrite the removed card, effectively halving your hand after the removed card. I removed one loop shifting the hand as it is only needed after choosing the first card.
The diff looks worse than it is as I also fixed the formatting.
The diff looks worse than it is as I also fixed the formatting.
- Code: Select all
if( event == EVENT_ETB_ABILITY ){
int kill_me = 1;
if( hand_count[player] > 1 ){
int p_hand[2][hand_count[player]];
int pc = 0; // player cards
int discarded[2];
int dc = 0; // cards to discard
int count = 0;
while( count < active_cards_count[player] ){
if( in_hand(player, count) ){
p_hand[0][pc] = get_original_internal_card_id(player, count);
p_hand[1][pc] = count;
pc++;
}
count++;
}
test_definition_t this_test;
new_default_test_definition(&this_test, TYPE_ANY, "Select a card to discard.");
while( dc < 2 ){
int selected = select_card_from_zone(player, player, p_hand[0], pc, 0, AI_MIN_VALUE, -1, &this_test);
if( selected != -1 ){
discarded[dc] = p_hand[1][selected];
dc++;
// Need this only once, hand is not shown after second choice
if (dc == 1 ) {
for(count = selected; count < pc; count++){
p_hand[0][count] = p_hand[0][count+1];
p_hand[1][count] = p_hand[1][count+1];
}
pc--; // <-- this was inside the loop
}
}
else{
break;
}
}
if( dc == 2 ){
discard_card(player, discarded[0]);
discard_card(player, discarded[1]);
kill_me = 0;
}
}
if( kill_me ){
kill_card(player, card, KILL_SACRIFICE );
}
}
- Attachments
-
dissension.zip
- (818 Bytes) Downloaded 167 times
---
Argivian Archaeologist in the Library of Leng studying the Spells of the Ancients
Argivian Archaeologist in the Library of Leng studying the Spells of the Ancients
Re: [still bug]Avatar of Discord bad selection
by Aswan jaguar » 10 Aug 2020, 17:40
Inserted above fix in commit 3c07db2. Thanks, FastEddie.


I totally feel you. I can't even estimate you how much time and frustration such bugs have cost me.FastEddie wrote:Simple issue once you got the hang of it... which took me 2 hours.

---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8129
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 477 times
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 24 guests