Affirmatively check hireling entry instead of relying upon loadID =0 which was a side effect.

This commit is contained in:
2023-04-04 13:48:56 -04:00
parent 1cb103c156
commit a01a342fd8
2 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -807,7 +807,8 @@ public class Mob extends AbstractIntelligenceAgent {
// only if this building has a blueprint. // only if this building has a blueprint.
// otherwise use the mob cache location. // otherwise use the mob cache location.
if (this.building != null && building.getBlueprintUUID() != 0) { if (this.building != null && building.getBlueprintUUID() != 0
&& this.building.getHirelings().contains(this) == false) {
int maxSlots = 10; int maxSlots = 10;
+5 -2
View File
@@ -352,9 +352,12 @@ public class NPC extends AbstractCharacter {
this.stamina.set(this.staminaMax); this.stamina.set(this.staminaMax);
} }
//add this npc to building // Add this npc to building hireling list if not there yet.
// For some reason the mob is initialized twice when
// createMobWithNoID() is called.
if (this.building != null) { if (this.building != null &&
this.building.getHirelings().contains(this) == false) {
int maxSlots = 10; int maxSlots = 10;