From de12dce50c7d53081ef00e6690bda3bf120de178 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 23 Mar 2014 07:57:34 +0100 Subject: [PATCH] * 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). --- .../Mage.Game.FreeForAll/src/mage/game/FreeForAll.java | 4 ++-- .../abilities/common/BeginningOfUpkeepTriggeredAbility.java | 5 ++++- Mage/src/mage/players/PlayerImpl.java | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java b/Mage.Server.Plugins/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java index e09a88db5f..5d17043a0f 100644 --- a/Mage.Server.Plugins/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java +++ b/Mage.Server.Plugins/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java @@ -74,7 +74,7 @@ public class FreeForAll extends GameImpl { @Override public Set getOpponents(UUID playerId) { - Set opponents = new HashSet(); + Set 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 { @Override public boolean isOpponent(Player player, UUID playerToCheck) { - return player.getInRange().contains(playerToCheck); + return !player.getId().equals(playerToCheck) && player.getInRange().contains(playerToCheck); } @Override diff --git a/Mage/src/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java b/Mage/src/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java index c4d7396108..f20d21bce6 100644 --- a/Mage/src/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java @@ -94,7 +94,7 @@ public class BeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImpl> 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