From 84bae3141c42270c5bc76b40f2bfb3f867957f74 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 4 Apr 2023 10:48:17 -0400 Subject: [PATCH] Slots are slots; blueprint logic not needed on back-end. --- src/engine/objects/Mob.java | 9 ++++----- src/engine/objects/NPC.java | 26 +++++--------------------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 077375e4..917994bb 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -804,17 +804,16 @@ public class Mob extends AbstractIntelligenceAgent { this.level = 1; //add this npc to building - if (this.building != null && this.loadID != 0 && building.getBlueprintUUID() != 0) { - int maxSlots; - maxSlots = building.getBlueprint().getSlotsForRank(this.building.getRank()); + if (this.building != null) { - for (int slot = 1; slot < maxSlots + 1; slot++) { + int maxSlots = 10; + + for (int slot = 1; slot < maxSlots + 1; slot++) if (!this.building.getHirelings().containsValue(slot)) { this.building.getHirelings().put(this, slot); break; } - } } //set bonuses diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index aed36832..a3740bf4 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -354,28 +354,12 @@ public class NPC extends AbstractCharacter { if (this.building != null) { - if (building.getBlueprint() != null) { + int maxSlots = 10; - int maxSlots; - maxSlots = building.getBlueprint().getSlotsForRank(this.building.getRank()); - - for (int slot = 1; slot < maxSlots + 1; slot++) { - - if (!this.building.getHirelings().containsValue(slot)) { - this.building.getHirelings().put(this, slot); - break; - } - } - } else { - - int maxSlots = 10; - - for (int slot = 1; slot < maxSlots + 1; slot++) { - if (!this.building.getHirelings().containsValue(slot)) { - this.building.getHirelings().put(this, slot); - break; - } - } + for (int slot = 1; slot < maxSlots + 1; slot++) + if (!this.building.getHirelings().containsValue(slot)) { + this.building.getHirelings().put(this, slot); + break; } }