It is currently 16 Apr 2024, 21:58
   
Text Size

Bugs

Moderators: silly freak, CCGHQ Admins

Bugs

Postby nantuko84 » 11 Sep 2010, 10:08

Here I will post bugs if find any.

Here is the first one (though it can be reproduced only in debug):
1. Replace
Code: Select all
 p.getLifeTotal().setLifeTotal(20);
by
Code: Select all
p.getLifeTotal().setLifeTotal(0);
in GameInitializer
2. Put break point on PhaseStructureImpl.#beforeReceivePriority:
Code: Select all
repeat = false;
Result: game goes into infinite loop
LoseOnLifeAction always returns true, so repeat variable is always true as well

but if I just run TestCardPanel, it's ok: game is over saying that both players have lost.
Mage\MagicWars blog: http://mwars.blogspot.com/
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Bugs

Postby silly freak » 11 Sep 2010, 11:33

Your interpretation of what's going is not correct. Both players loose the game in the game initializer:

Code: Select all
//start the first turn
game.getPhaseStructure().takeAction(false);
which implicitly checks state based actions

then, when GameLoop.run is called, it doesn't check for winning and losing until the prior player has performed an action. I resolved it by moving the check to the beginning of the loop.

btw, in what usecase does this behavior matter?
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Bugs

Postby nantuko84 » 11 Sep 2010, 12:28

do you mean that LoseOnLifeAction will never return "true" inside beforeReceivePriority?
Mage\MagicWars blog: http://mwars.blogspot.com/
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Bugs

Postby silly freak » 11 Sep 2010, 12:56

it will, but only once. The action iterates over getPlayersInGame(). After loseGame() was called on the player, it won't be in that list, so during the next loop it will return false (normally)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times


Return to Development

Who is online

Users browsing this forum: No registered users and 9 guests


Who is online

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

Login Form