From ca787f7a506c84cc4b942e267488da98f6c303b2 Mon Sep 17 00:00:00 2001 From: Treeku Date: Sun, 13 Jul 2014 22:17:07 +0100 Subject: [PATCH] Fixed issue with badly configured weapons breaking --- src/resources/objects/weapon/WeaponObject.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/resources/objects/weapon/WeaponObject.java b/src/resources/objects/weapon/WeaponObject.java index 4fca13d7..a06010ec 100644 --- a/src/resources/objects/weapon/WeaponObject.java +++ b/src/resources/objects/weapon/WeaponObject.java @@ -127,6 +127,11 @@ public class WeaponObject extends TangibleObject implements Serializable { } public int getWeaponType() { + if (getStringAttribute("cat_wpn_damage.wpn_category") == null) { + System.err.println("Error: Weapon Type not defined for " + getTemplate()); + return 6; + } + return Integer.parseInt(getStringAttribute("cat_wpn_damage.wpn_category").replace("@obj_attr_n:wpn_category_", "")); }