From 6cfd07846922fa94ba0d5bb7bada6e56268f82eb Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 29 Apr 2023 14:00:24 -0400 Subject: [PATCH] Removed old methods from codepath. --- src/engine/gameManager/BuildingManager.java | 1 - src/engine/objects/Mob.java | 59 --------------------- src/engine/server/world/WorldServer.java | 1 - 3 files changed, 61 deletions(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 5b39a9ca..bb5ceab2 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -520,7 +520,6 @@ public enum BuildingManager { mob.setRank(rank); mob.setPlayerGuard(true); - mob.setParentZone(zone); return true; } diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index f11e0283..b0f35c06 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -247,8 +247,6 @@ public class Mob extends AbstractIntelligenceAgent { this.bindLoc = new Vector3fImmutable(this.statLat, this.statAlt, this.statLon); - this.setParentZone(ZoneManager.getZoneByUUID(this.parentZoneID)); - this.runeSet = rs.getInt("runeSet"); this.bootySet = rs.getInt("bootySet"); @@ -499,9 +497,6 @@ public class Mob extends AbstractIntelligenceAgent { Mob mobWithoutID = new Mob(pirateName, "", (short) 0, (short) 0, (short) 0, (short) 0, (short) 0, (short) 1, 0, false, false, false, spawn, spawn, Vector3fImmutable.ZERO, (short) 1, (short) 1, (short) 1, guild, (byte) 0, loadID, isMob, parent, building, contractID); - if (parent != null) - mobWithoutID.setRelPos(parent, spawn.x - parent.absX, spawn.y - parent.absY, spawn.z - parent.absZ); - if (mobWithoutID.mobBase == null) return null; mobWithoutID.level = (short) level; @@ -512,7 +507,6 @@ public class Mob extends AbstractIntelligenceAgent { mob = DbManager.MobQueries.ADD_MOB(mobWithoutID); mob.setObjectTypeMask(MBServerStatics.MASK_MOB | mob.getTypeMasks()); mob.setMob(); - mob.setParentZone(parent); mob.setInBuildingLoc(building, mob); Vector3fImmutable buildingWorldLoc = ZoneManager.convertLocalToWorld(building, mob.inBuildingLoc); mob.setBindLoc(buildingWorldLoc); @@ -538,9 +532,7 @@ public class Mob extends AbstractIntelligenceAgent { mob = new Mob(mobBase, guild, parent, level, owner, 0); if (mob.mobBase == null) return null; mob.runAfterLoad(); - Vector3fImmutable loc = owner.getLoc(); - if (parent != null) mob.setRelPos(parent, loc.x - parent.absX, loc.y - parent.absY, loc.z - parent.absZ); DbManager.addToCache(mob); mob.setPet(owner, true); mob.setWalkMode(false); @@ -700,13 +692,10 @@ public class Mob extends AbstractIntelligenceAgent { } } - if (parent != null) mob.setRelPos(parent, loc.x - parent.absX, loc.y - parent.absY, loc.z - parent.absZ); - mob.setObjectTypeMask(MBServerStatics.MASK_MOB | mob.getTypeMasks()); // mob.setMob(); mob.isPlayerGuard = true; - mob.setParentZone(parent); DbManager.addToCache(mob); RuneBase guardRune = RuneBase.getRuneBase(252621); @@ -776,13 +765,10 @@ public class Mob extends AbstractIntelligenceAgent { mob.despawned = true; DbManager.addToCache(mob); - if (parent != null) mob.setRelPos(parent, loc.x - parent.absX, loc.y - parent.absY, loc.z - parent.absZ); - mob.setObjectTypeMask(MBServerStatics.MASK_MOB | mob.getTypeMasks()); //mob.setMob(); mob.setSiege(true); - mob.setParentZone(parent); int slot = 0; @@ -982,35 +968,6 @@ public class Mob extends AbstractIntelligenceAgent { return this.parentZone; } - public void setParentZone(Zone zone) { - - if (this.parentZone == null) { - zone.zoneMobSet.add(this); - this.parentZone = zone; - } - - if (this.building != null) { - - Vector3fImmutable localLoc = new Vector3fImmutable(this.statLat, this.statAlt, this.statLon); - Vector3fImmutable buildingWorldLoc = ZoneManager.convertLocalToWorld(this.building, localLoc); - this.setBindLoc(buildingWorldLoc); - this.setLoc(buildingWorldLoc); - this.endLoc = buildingWorldLoc; - this.stopMovement(endLoc); - - if (this.building.getBlueprintUUID() != 0 && this.building.getBlueprint().isWallPiece() && this.contract == null) - MovementManager.translocate(this, new Vector3fImmutable(this.building.getLoc().x, this.npcOwner.getLoc().y, this.building.getLoc().z), this.region); - - return; - } - - Vector3fImmutable localLoc = new Vector3fImmutable(this.statLat + zone.absX, this.statAlt + zone.absY, this.statLon + zone.absZ); - this.setBindLoc(localLoc); - this.setLoc(localLoc); - this.endLoc = localLoc; - this.stopMovement(endLoc); - } - public int getParentZoneID() { if (this.parentZone != null) return this.parentZone.getObjectUUID(); @@ -1324,22 +1281,6 @@ public class Mob extends AbstractIntelligenceAgent { this.charItemManager.clearInventory(); } - //Sets the relative position to a parent zone - public void setRelPos(Zone zone, float locX, float locY, float locZ) { - - //update mob zone map - - if (this.parentZone != null) this.parentZone.zoneMobSet.remove(this); - - zone.zoneMobSet.add(this); - - this.statLat = locX; - this.statAlt = locY; - this.statLon = locZ; - this.parentZone = zone; - this.setBindLoc(new Vector3fImmutable(this.statLat + zone.absX, this.statAlt + zone.absY, this.statLon + zone.absZ)); - } - @Override public boolean canBeLooted() { return !this.isAlive(); diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 15ea7046..c27c6536 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -543,7 +543,6 @@ public class WorldServer { for (Mob m : mobs) { m.setObjectTypeMask(MBServerStatics.MASK_MOB | m.getTypeMasks()); m.setLoc(m.getLoc()); - m.setParentZone(zone); //ADD GUARDS HERE. if (m.building != null && m.building.getBlueprint() != null && m.building.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK)