From 31f8b5a294e9a7faeac39d47b625931b01818872 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 19 Aug 2024 07:08:09 -0400 Subject: [PATCH] One or more whitspaces --- src/engine/wpak/EffectsParser.java | 2 +- src/engine/wpak/PowersParser.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/engine/wpak/EffectsParser.java b/src/engine/wpak/EffectsParser.java index 02b919c5..44faed9b 100644 --- a/src/engine/wpak/EffectsParser.java +++ b/src/engine/wpak/EffectsParser.java @@ -114,7 +114,7 @@ public class EffectsParser { String[] conditions = matcher.group().trim().split("\n"); for (String condition : conditions) { - String[] parameters = condition.trim().split(" "); + String[] parameters = condition.trim().split("\\s+"); effectEntry.conditions.put(parameters[0], Float.parseFloat(parameters[1])); } } diff --git a/src/engine/wpak/PowersParser.java b/src/engine/wpak/PowersParser.java index c01aa00d..46570fea 100644 --- a/src/engine/wpak/PowersParser.java +++ b/src/engine/wpak/PowersParser.java @@ -152,7 +152,11 @@ public class PowersParser { switch (key) { case "ACTION": powerAction = new PowerAction(); - arguments = lineValues[1].trim().split(" "); + arguments = lineValues[1].trim().split("\\s+"); + + if (powerEntry.power_id.equals("HNT-050")) + Logger.error("debug"); + powerAction.effect_id = arguments[0]; powerAction.minTrains = Integer.parseInt(arguments[1]); powerAction.maxTrains = Integer.parseInt(arguments[2]); @@ -167,7 +171,7 @@ public class PowersParser { powerEntry.maxLevel = Integer.parseInt(lineValues[1].trim()); break; case "HateValue": - arguments = lineValues[1].trim().split(" "); + arguments = lineValues[1].trim().split("\\s+"); powerEntry.hateValue = Integer.parseInt(arguments[0]); // Not all entries have a curve. Defaults to DefaultFlat; @@ -188,7 +192,7 @@ public class PowersParser { powerEntry.category = lineValues[1].trim(); break; case "CURVE": - arguments = lineValues[1].trim().split(" "); + arguments = lineValues[1].trim().split("\\s+"); powerEntry.slopeType = arguments[0]; powerEntry.curve = mbEnums.CompoundCurveType.valueOf(arguments[1]); break;