Fixed issue #197 effects of players lasted beyond their lost in a free for all game.

This commit is contained in:
LevelX2 2013-04-19 23:07:08 +02:00
parent b600b03e65
commit 9c90d66d6d

View file

@ -87,6 +87,7 @@ import org.apache.log4j.Logger;
import java.io.IOException;
import java.io.Serializable;
import java.util.*;
import java.util.Map.Entry;
public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializable {
@ -1515,6 +1516,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
it.remove();
}
}
this.getState().getContinuousEffects().removeInactiveEffects(this);
for (Iterator<StackObject> it = getStack().iterator(); it.hasNext();) {
StackObject object = it.next();
if (object.getControllerId().equals(playerId)) {
@ -1527,6 +1529,16 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
perm.moveToExile(null, "", null, this);
}
}
Iterator it = gameCards.entrySet().iterator();
while(it.hasNext()) {
Entry<UUID,Card> entry = (Entry<UUID,Card>) it.next();
Card card = entry.getValue();
if (card.getOwnerId().equals(playerId)) {
it.remove();
}
}
}
@Override