Fixed NPE in monte carlo. Removed actions remembering for now as not used yet.

This commit is contained in:
magenoxx 2012-02-14 08:55:42 +04:00
parent 48f5a469d4
commit cb929d1f21
2 changed files with 4 additions and 1 deletions

View file

@ -40,6 +40,9 @@ public abstract class MageAction {
* @return
*/
public int getScore(final Player player) {
if (player == null || scorePlayer == null) {
return 0;
}
if (player.getId().equals(scorePlayer.getId())) {
return score;
} else {

View file

@ -1359,7 +1359,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
@Override
public int doAction(MageAction action) {
actions.add(action);
//actions.add(action);
int value = action.doAction(this);
score += action.getScore(scorePlayer);
return value;