mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +00:00
* 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:
parent
6993d7f725
commit
de12dce50c
3 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -94,7 +94,7 @@ public class BeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImpl<Begi
|
|||
}
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case ANY:
|
||||
if (setTargetPointer && getTargets().size() == 0) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue