mirror of
https://github.com/correl/mage.git
synced 2025-01-13 11:01:58 +00:00
* Order of Succession - Fixed multiplayer handling if player already lost or left.
This commit is contained in:
parent
e2b4128b2a
commit
5597b412bf
1 changed files with 7 additions and 2 deletions
|
@ -99,7 +99,8 @@ class OrderOfSuccessionEffect extends OneShotEffect {
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Map<UUID, UUID> playerCreature = new HashMap<>();
|
Map<UUID, UUID> playerCreature = new HashMap<>();
|
||||||
boolean left = source.getChoices().get(0).getChoice().equals("Left");
|
boolean left = source.getChoices().get(0).getChoice().equals("Left");
|
||||||
PlayerList playerList = game.getState().getPlayerList();
|
PlayerList playerList = game.getState().getPlayerList().copy();
|
||||||
|
// set playerlist to controller
|
||||||
while (!playerList.get().equals(source.getControllerId()) && controller.isInGame()) {
|
while (!playerList.get().equals(source.getControllerId()) && controller.isInGame()) {
|
||||||
playerList.getNext();
|
playerList.getNext();
|
||||||
}
|
}
|
||||||
|
@ -112,10 +113,14 @@ class OrderOfSuccessionEffect extends OneShotEffect {
|
||||||
if (nextPlayer == null) {
|
if (nextPlayer == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// save first next player to check for iteration stop
|
||||||
if (firstNextPlayer == null) {
|
if (firstNextPlayer == null) {
|
||||||
firstNextPlayer = nextPlayer.getId();
|
firstNextPlayer = nextPlayer.getId();
|
||||||
}
|
}
|
||||||
// if player is in range he chooses an creature to control
|
if (!nextPlayer.isInGame()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// if player is in range he chooses a creature to control
|
||||||
if (currentPlayer != null && controller.getInRange().contains(currentPlayer.getId())) {
|
if (currentPlayer != null && controller.getInRange().contains(currentPlayer.getId())) {
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("creature controlled by ").append(nextPlayer.getName()).toString());
|
FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("creature controlled by ").append(nextPlayer.getName()).toString());
|
||||||
filter.add(new ControllerIdPredicate(nextPlayer.getId()));
|
filter.add(new ControllerIdPredicate(nextPlayer.getId()));
|
||||||
|
|
Loading…
Reference in a new issue