mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
Fixed NPE in TurnMods (fixes #296).
This commit is contained in:
parent
1d6ee80e4c
commit
271e4b61ba
1 changed files with 13 additions and 6 deletions
|
|
@ -107,12 +107,19 @@ public class TurnMods extends ArrayList<TurnMod> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean skipStep(UUID playerId, PhaseStep step) {
|
public boolean skipStep(UUID playerId, PhaseStep step) {
|
||||||
ListIterator<TurnMod> it = this.listIterator(this.size());
|
if (step != null) {
|
||||||
while (it.hasPrevious()) {
|
ListIterator<TurnMod> it = this.listIterator(this.size());
|
||||||
TurnMod turnMod = it.previous();
|
while (it.hasPrevious()) {
|
||||||
if (turnMod.getSkipStep() != null && turnMod.getPlayerId().equals(playerId) && turnMod.getSkipStep() == step) {
|
TurnMod turnMod = it.previous();
|
||||||
it.remove();
|
if (turnMod.getSkipStep() != null) {
|
||||||
return true;
|
if (turnMod.getPlayerId().equals(playerId)) {
|
||||||
|
if (turnMod.getSkipStep() == step) {
|
||||||
|
it.remove();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue