Parcourir la source

Fix for #DP4685 by nik

MELERIX il y a 14 ans
Parent
commit
60ac8181ff

+ 4 - 3
L2J_Server/java/com/l2jserver/gameserver/skills/hitConditionBonus.java

@@ -74,7 +74,7 @@ public class hitConditionBonus
 	static
 	{
 		final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-		factory.setValidating(false);
+		factory.setIgnoringElementContentWhitespace(true);
 		factory.setIgnoringComments(true);
 		final File file = new File(Config.DATAPACK_ROOT, "data/stats/hitConditionBonus.xml");
 		Document doc = null;
@@ -91,17 +91,18 @@ public class hitConditionBonus
 			}
 			
 			String name;
-			int bonus = 0;
 			for (Node list = doc.getFirstChild(); list != null; list = list.getNextSibling())
 			{
 				if ("hitConditionBonus".equalsIgnoreCase(list.getNodeName()) || "list".equalsIgnoreCase(list.getNodeName()))
 				{
 					for (Node cond = list.getFirstChild(); cond != null; cond = cond.getNextSibling())
 					{
+						int bonus = 0;
 						name = cond.getNodeName();
 						try
 						{
-							bonus = Integer.parseInt(cond.getAttributes().getNamedItem("val").getNodeValue());							
+							if (cond.hasAttributes())
+								bonus = Integer.parseInt(cond.getAttributes().getNamedItem("val").getNodeValue());							
 						}
 						catch (Exception e)
 						{