From 3e71d072f7aa95fdca58eee1fc0fa33a1f06a142 Mon Sep 17 00:00:00 2001 From: Danial Date: Sat, 12 Oct 2019 14:06:30 +1300 Subject: [PATCH] attempt to fix fletchibng crash (#52) --- .../src/redone/game/items/ItemDefinitions.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/2006Redone Server/src/redone/game/items/ItemDefinitions.java b/2006Redone Server/src/redone/game/items/ItemDefinitions.java index c9bc66df..8e50e0d7 100644 --- a/2006Redone Server/src/redone/game/items/ItemDefinitions.java +++ b/2006Redone Server/src/redone/game/items/ItemDefinitions.java @@ -227,12 +227,11 @@ public class ItemDefinitions { * Returns the weight of an item. */ public static double getWeight(int id) { - try { + if (id >= 0 && id < definitions.length) return definitions[id].weight; - } catch (NullPointerException noId) { - System.out.println("WARNING: id " + id + " doesn't have a definition!"); - return 0; - } + + System.out.println("WARNING: id " + id + " doesn't have a definition!"); + return 0.0; } /**