mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Fixed NPEs in the new prompt input code (we should not assume that SA vars will be filled in at all times).
This commit is contained in:
@@ -61,8 +61,8 @@ public class InputConfirm extends InputSyncronizedBase {
|
||||
noButtonText = noButtonText0;
|
||||
defaultYes = defaultYes0;
|
||||
result = defaultYes0;
|
||||
this.sa = null;
|
||||
this.card = null;
|
||||
this.sa = null;
|
||||
this.card = null;
|
||||
}
|
||||
|
||||
public InputConfirm(final PlayerControllerHuman controller, String message0, SpellAbility sa0) {
|
||||
@@ -80,8 +80,8 @@ public class InputConfirm extends InputSyncronizedBase {
|
||||
noButtonText = noButtonText0;
|
||||
defaultYes = defaultYes0;
|
||||
result = defaultYes0;
|
||||
this.sa = sa0;
|
||||
this.card = sa.getView().getHostCard();
|
||||
this.sa = sa0;
|
||||
this.card = sa != null ? sa.getView().getHostCard() : null;
|
||||
}
|
||||
|
||||
public InputConfirm(final PlayerControllerHuman controller, String message0, CardView card0) {
|
||||
@@ -99,8 +99,8 @@ public class InputConfirm extends InputSyncronizedBase {
|
||||
noButtonText = noButtonText0;
|
||||
defaultYes = defaultYes0;
|
||||
result = defaultYes0;
|
||||
this.sa = null ;
|
||||
this.card = card0;
|
||||
this.sa = null ;
|
||||
this.card = card0;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
||||
@@ -36,7 +36,9 @@ public abstract class InputSelectManyBase<T extends GameEntity> extends InputSyn
|
||||
protected InputSelectManyBase(final PlayerControllerHuman controller, final int min, final int max, final SpellAbility sa0) {
|
||||
this(controller,min,max);
|
||||
this.sa = sa0;
|
||||
this.card = sa0.getView().getHostCard();
|
||||
if (sa0 != null) {
|
||||
this.card = sa0.getView().getHostCard();
|
||||
}
|
||||
}
|
||||
|
||||
protected InputSelectManyBase(final PlayerControllerHuman controller, final int min, final int max, final CardView card0) {
|
||||
|
||||
@@ -1031,9 +1031,9 @@ public class PlayerControllerHuman
|
||||
default: labels = ImmutableList.copyOf(kindOfChoice.toString().split("Or"));
|
||||
}
|
||||
// return getGui().confirm(CardView.get(sa.getHostCard()), question, defaultVal == null || defaultVal.booleanValue(), labels);
|
||||
final InputConfirm inp = new InputConfirm(this, question, labels.get(0), labels.get(1), defaultVal == null || defaultVal.booleanValue(), sa);
|
||||
inp.showAndWait();
|
||||
return inp.getResult();
|
||||
final InputConfirm inp = new InputConfirm(this, question, labels.get(0), labels.get(1), defaultVal == null || defaultVal.booleanValue(), sa);
|
||||
inp.showAndWait();
|
||||
return inp.getResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user