From 00aa06c5f1ba006766690e07930dd681639cc921 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 19 Aug 2024 15:24:28 -0400 Subject: [PATCH] Condition fix --- src/engine/wpak/PowersParser.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/engine/wpak/PowersParser.java b/src/engine/wpak/PowersParser.java index 54311c51..d55f76b2 100644 --- a/src/engine/wpak/PowersParser.java +++ b/src/engine/wpak/PowersParser.java @@ -289,11 +289,13 @@ public class PowersParser { // Parse power conditions - String[] conditions = conditionString.toString().split("\n"); + if (conditionString.toString().isEmpty() == false) { + String[] conditions = conditionString.toString().split("\n"); - for (String condition : conditions) { - String[] parameters = condition.trim().split("\\s+"); - powerEntry.conditions.put(parameters[0], Float.parseFloat(parameters[1])); + for (String condition : conditions) { + String[] parameters = condition.trim().split("\\s+"); + powerEntry.conditions.put(parameters[0], Float.parseFloat(parameters[1])); + } } } catch (Exception e) {