mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Improve handling for SVars in PresentCompare
This commit is contained in:
@@ -215,7 +215,6 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (params.containsKey("IsPresent")) {
|
if (params.containsKey("IsPresent")) {
|
||||||
final String sIsPresent = params.get("IsPresent");
|
final String sIsPresent = params.get("IsPresent");
|
||||||
String presentCompare = "GE1";
|
String presentCompare = "GE1";
|
||||||
@@ -244,10 +243,10 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView {
|
|||||||
|
|
||||||
int right = 1;
|
int right = 1;
|
||||||
final String rightString = presentCompare.substring(2);
|
final String rightString = presentCompare.substring(2);
|
||||||
if (rightString.equals("X")) {
|
try {
|
||||||
right = CardFactoryUtil.xCount(this.getHostCard(), this.getHostCard().getSVar("X"));
|
right = Integer.parseInt(rightString);
|
||||||
} else {
|
} catch (final NumberFormatException nfe) {
|
||||||
right = Integer.parseInt(presentCompare.substring(2));
|
right = CardFactoryUtil.xCount(this.getHostCard(), this.getHostCard().getSVar(rightString));
|
||||||
}
|
}
|
||||||
final int left = list.size();
|
final int left = list.size();
|
||||||
|
|
||||||
@@ -285,10 +284,10 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView {
|
|||||||
|
|
||||||
int right = 1;
|
int right = 1;
|
||||||
final String rightString = presentCompare.substring(2);
|
final String rightString = presentCompare.substring(2);
|
||||||
if (rightString.equals("X")) {
|
try {
|
||||||
right = CardFactoryUtil.xCount(this.getHostCard(), this.getHostCard().getSVar("X"));
|
right = Integer.parseInt(rightString);
|
||||||
} else {
|
} catch (final NumberFormatException nfe) {
|
||||||
right = Integer.parseInt(presentCompare.substring(2));
|
right = CardFactoryUtil.xCount(this.getHostCard(), this.getHostCard().getSVar(rightString));
|
||||||
}
|
}
|
||||||
final int left = list.size();
|
final int left = list.size();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user