* Free for all - Fixed a bug that controller of a spell was sometimes affected by effects that should only be applied to opponents (e.g. Mogis, God of Slaughter's triggered ability).

This commit is contained in:
LevelX2 2014-03-23 07:57:34 +01:00
parent 6993d7f725
commit de12dce50c
3 changed files with 7 additions and 4 deletions

View file

@ -74,7 +74,7 @@ public class FreeForAll extends GameImpl<FreeForAll> {
@Override
public Set<UUID> getOpponents(UUID playerId) {
Set<UUID> opponents = new HashSet<UUID>();
Set<UUID> opponents = new HashSet<>();
for (UUID opponentId: this.getPlayer(playerId).getInRange()) {
if (!opponentId.equals(playerId)) {
opponents.add(opponentId);
@ -85,7 +85,7 @@ public class FreeForAll extends GameImpl<FreeForAll> {
@Override
public boolean isOpponent(Player player, UUID playerToCheck) {
return player.getInRange().contains(playerToCheck);
return !player.getId().equals(playerToCheck) && player.getInRange().contains(playerToCheck);
}
@Override

View file

@ -115,6 +115,9 @@ public class BeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImpl<Begi
return true;
}
}
break;
default:
throw new UnsupportedOperationException("Value for targetController not supported: " + targetController.toString());
}
}
return false;

View file

@ -2170,7 +2170,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
@Override
public boolean hasOpponent(UUID playerToCheckId, Game game) {
return game.isOpponent(this, playerToCheckId);
return !this.getId().equals(playerToCheckId) && game.isOpponent(this, playerToCheckId);
}
@Override