mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Fixed a crash (varolz, the scar-striped + dryad arbor)
This commit is contained in:
@@ -283,6 +283,9 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
|
||||
public String getShortString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int generic = getGenericCost();
|
||||
if (this.isZero()) {
|
||||
sb.append('0');
|
||||
}
|
||||
if (generic > 0) {
|
||||
sb.append(generic);
|
||||
}
|
||||
|
||||
@@ -601,7 +601,13 @@ public final class StaticAbilityContinuous {
|
||||
if (addKeywords != null) {
|
||||
newKeywords = Arrays.copyOf(addKeywords, addKeywords.length);
|
||||
for (int j = 0; j < newKeywords.length; ++j) {
|
||||
newKeywords[j] = newKeywords[j].replace("CardManaCost", affectedCard.getManaCost().getShortString());
|
||||
if (newKeywords[j].contains("CardManaCost")) {
|
||||
if (affectedCard.getManaCost().isNoCost()) {
|
||||
newKeywords[j] = ""; // prevent a crash (varolz the scar-striped + dryad arbor)
|
||||
} else {
|
||||
newKeywords[j] = newKeywords[j].replace("CardManaCost", affectedCard.getManaCost().getShortString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user