From bc720a600950d820b9d396b1d1b287cf8d3a90d5 Mon Sep 17 00:00:00 2001 From: Robin K Date: Wed, 6 Apr 2022 16:17:58 +0200 Subject: [PATCH] Add small bugfix for XDF layer --- .../xml/ConversionLayer/XDFConversionLayer.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/romraider/xml/ConversionLayer/XDFConversionLayer.java b/src/main/java/com/romraider/xml/ConversionLayer/XDFConversionLayer.java index 776f97e2..880b77d9 100644 --- a/src/main/java/com/romraider/xml/ConversionLayer/XDFConversionLayer.java +++ b/src/main/java/com/romraider/xml/ConversionLayer/XDFConversionLayer.java @@ -308,7 +308,7 @@ public class XDFConversionLayer extends ConversionLayer { scaling.setAttribute("format", format); } else if (!hasEmbedInfo && n.getNodeName().equalsIgnoreCase("math")) { String formula = n.getAttributes().getNamedItem("equation").getNodeValue(); - formula = formula.replace("X", "x"); + formula = formula.replace("X", "x").replace(",", "."); scaling.setAttribute("expression", formula); } @@ -434,10 +434,14 @@ public class XDFConversionLayer extends ConversionLayer { } else if (n.getNodeName().equalsIgnoreCase("description")) { // TODO } else if (n.getNodeName().equalsIgnoreCase("BASEOFFSET")) { - offset = Integer.parseInt(n.getAttributes().getNamedItem("offset").getNodeValue()); - - if (!n.getAttributes().getNamedItem("subtract").getNodeValue().equals("0")) { - offset *= -1; + Node offsetNode = n.getAttributes().getNamedItem("offset"); + + if(offsetNode != null) { + offset = Integer.parseInt(offsetNode.getNodeValue()); + + if (!n.getAttributes().getNamedItem("subtract").getNodeValue().equals("0")) { + offset *= -1; + } } } else if (n.getNodeName().equalsIgnoreCase("DEFAULTS")) { if (!n.getAttributes().getNamedItem("float").getNodeValue().equalsIgnoreCase("0")) {