Page 1 of 1

Bugs

PostPosted: 11 Sep 2010, 10:08
by nantuko84
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.

Re: Bugs

PostPosted: 11 Sep 2010, 11:33
by silly freak
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?

Re: Bugs

PostPosted: 11 Sep 2010, 12:28
by nantuko84
do you mean that LoseOnLifeAction will never return "true" inside beforeReceivePriority?

Re: Bugs

PostPosted: 11 Sep 2010, 12:56
by silly freak
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)