Browse Source

Needs contract null check

mobile-class-refactor
MagicBot 1 year ago
parent
commit
098433b697
  1. 9
      src/engine/objects/Mob.java

9
src/engine/objects/Mob.java

@ -1693,7 +1693,9 @@ public class Mob extends AbstractIntelligenceAgent {
else else
this.contract = DbManager.ContractQueries.GET_CONTRACT(this.contractUUID); this.contract = DbManager.ContractQueries.GET_CONTRACT(this.contractUUID);
// Guard captaiin AI // Guard captain AI
if (this.contract != null) {
if (NPC.ISGuardCaptain(contract.getContractID())) { if (NPC.ISGuardCaptain(contract.getContractID())) {
this.spawnTime = 60 * 15; this.spawnTime = 60 * 15;
@ -1702,7 +1704,7 @@ public class Mob extends AbstractIntelligenceAgent {
// Load AI for wall archers // Load AI for wall archers
if (this.contract != null && NPC.ISWallArcher(this.contract)) { if (NPC.ISWallArcher(this.contract)) {
this.behaviourType = MobBehaviourType.GuardWallArcher; this.behaviourType = MobBehaviourType.GuardWallArcher;
this.isPlayerGuard = true; this.isPlayerGuard = true;
this.spawnTime = 450; this.spawnTime = 450;
@ -1710,12 +1712,13 @@ public class Mob extends AbstractIntelligenceAgent {
// Load AI for guard dogs // Load AI for guard dogs
if (this.contract != null && this.contract.getContractID() == 910) { if (this.contract.getContractID() == 910) {
this.isPlayerGuard = true; this.isPlayerGuard = true;
this.behaviourType = MobBehaviourType.GuardCaptain; this.behaviourType = MobBehaviourType.GuardCaptain;
this.spawnTime = 900; this.spawnTime = 900;
this.guardedCity = ZoneManager.getCityAtLocation(this.bindLoc); this.guardedCity = ZoneManager.getCityAtLocation(this.bindLoc);
} }
}
if (this.building != null) if (this.building != null)
this.guild = this.building.getGuild(); this.guild = this.building.getGuild();

Loading…
Cancel
Save