From e4b08239110b74bd59f5d91fb97a47d265025359 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 16 Mar 2024 09:01:56 -0400 Subject: [PATCH] Refactor of item.name; simplification. --- src/engine/objects/Item.java | 7 +++---- src/engine/objects/ItemFactory.java | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/engine/objects/Item.java b/src/engine/objects/Item.java index 52c5f57f..7c9ad7ca 100644 --- a/src/engine/objects/Item.java +++ b/src/engine/objects/Item.java @@ -68,7 +68,6 @@ public class Item extends AbstractWorldObject { super(); this.templateID = templateID; this.template = ItemTemplate.templates.get(templateID); - this.name = this.template.item_base_name; this.chargesRemaining = this.template.item_initial_charges; this.durabilityCurrent = this.template.combat_health_full; this.equipSlot = EquipSlotType.NONE; @@ -90,12 +89,12 @@ public class Item extends AbstractWorldObject { if (this.template == null) Logger.error("Null template of " + this.templateID); + // Name override in db. + this.name = rs.getString("item_name"); if (this.name == null) - this.name = this.template.item_base_name; - else if (this.name.isEmpty()) - this.name = this.template.item_base_name; + this.name = ""; // Set container enumeration diff --git a/src/engine/objects/ItemFactory.java b/src/engine/objects/ItemFactory.java index f34f5d43..5bfb135d 100644 --- a/src/engine/objects/ItemFactory.java +++ b/src/engine/objects/ItemFactory.java @@ -583,7 +583,6 @@ public class ItemFactory { //set value to 0 so magicvalue can be recalculated in getValue. ml.setValue(0); - float time; float rank = npc.getBuilding().getRank() - 1; float rate = (float) (2.5 * rank);