forked from MagicBane/Server
Slots are slots; blueprint logic not needed on back-end.
This commit is contained in:
@@ -804,18 +804,17 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.level = 1;
|
this.level = 1;
|
||||||
|
|
||||||
//add this npc to building
|
//add this npc to building
|
||||||
if (this.building != null && this.loadID != 0 && building.getBlueprintUUID() != 0) {
|
|
||||||
|
|
||||||
int maxSlots;
|
if (this.building != null) {
|
||||||
maxSlots = building.getBlueprint().getSlotsForRank(this.building.getRank());
|
|
||||||
|
|
||||||
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)) {
|
if (!this.building.getHirelings().containsValue(slot)) {
|
||||||
this.building.getHirelings().put(this, slot);
|
this.building.getHirelings().put(this, slot);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//set bonuses
|
//set bonuses
|
||||||
this.bonuses = new PlayerBonuses(this);
|
this.bonuses = new PlayerBonuses(this);
|
||||||
|
|||||||
@@ -354,30 +354,14 @@ public class NPC extends AbstractCharacter {
|
|||||||
|
|
||||||
if (this.building != null) {
|
if (this.building != null) {
|
||||||
|
|
||||||
if (building.getBlueprint() != null) {
|
|
||||||
|
|
||||||
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;
|
int maxSlots = 10;
|
||||||
|
|
||||||
for (int slot = 1; slot < maxSlots + 1; slot++) {
|
for (int slot = 1; slot < maxSlots + 1; slot++)
|
||||||
if (!this.building.getHirelings().containsValue(slot)) {
|
if (!this.building.getHirelings().containsValue(slot)) {
|
||||||
this.building.getHirelings().put(this, slot);
|
this.building.getHirelings().put(this, slot);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO set these correctly later
|
//TODO set these correctly later
|
||||||
this.rangeHandOne = 8;
|
this.rangeHandOne = 8;
|
||||||
|
|||||||
Reference in New Issue
Block a user