From 0bca0d24a20ca713dd1c9ef042dcc64d3b795fef Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Sun, 29 Mar 2020 21:57:32 -0400 Subject: Fix up ReplPair There was something in ReplPair that was causing issues. Since we don't need any of the fancy ReplPair functionality, I ripped it all out, since it was causing issues (probably sorting-related, with a comparator or something missing somewhere) --- src/main/java/tlIItools/Effect.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/main/java/tlIItools/Effect.java') diff --git a/src/main/java/tlIItools/Effect.java b/src/main/java/tlIItools/Effect.java index 3efec6de..5c8b203a 100644 --- a/src/main/java/tlIItools/Effect.java +++ b/src/main/java/tlIItools/Effect.java @@ -291,10 +291,10 @@ public class Effect { // Expand aliases first. - for (ReplPair repl : replList) { + for (ReplPair repl : replList) { fmt = fmt.replaceAll(repl.find, repl.replace); } - + if (minValue <= 0 && maxValue <= 0) { fmt = fmt.replaceAll("]+)\\|([^|>]+)>", "$1"); } @@ -310,9 +310,9 @@ public class Effect { if (minPer >= 0 && maxPer >= 0) { fmt = fmt.replaceAll("]+)\\|([^|>]+)>", "$2"); } - + if (fmt.contains("<") || fmt.contains(">")) { - AffixLister.errOut.printf("WARN: Details for effect %s are malformated (contains < or >):\n\t%s\n", type, fmt); + AffixLister.errOut.printf("WARN: Details for effect %s are malformatted (contains < or >):\n\t%s\n", type, fmt); } sb.append(String.format(fmt, Math.abs(minValue), Math.abs(maxValue), duration, damageType.toLowerCase(), level, resist, name, Math.abs(minPer), Math.abs(maxPer), range, maxCount, pulse)); @@ -434,7 +434,11 @@ public class Effect { } else { efct.hasDuration = true; - efct.duration = Double.parseDouble(splits[1]); + if (splits[1].equalsIgnoreCase("instant")) { + efct.duration = -1; + } else { + efct.duration = Double.parseDouble(splits[1]); + } } } else if (ln.contains("MIN:")) { efct.minValue = Double.parseDouble(splits[1]); -- cgit v1.2.3