From 8b2a07e8605bcf82f7c68ad7ea9fa8494fd3f0d2 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 22 Jul 2023 10:40:54 -0400 Subject: [PATCH 1/5] Unused method removed. --- src/engine/gameManager/BuildingManager.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 990c4efd..d9ea9810 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -17,7 +17,6 @@ import engine.job.JobContainer; import engine.job.JobScheduler; import engine.jobs.UpgradeBuildingJob; import engine.math.Bounds; -import engine.math.Quaternion; import engine.math.Vector3fImmutable; import engine.net.client.msg.ErrorPopupMsg; import engine.objects.*; @@ -72,21 +71,6 @@ public enum BuildingManager { return buildingLocation; } - public static Quaternion getSlotRotation(Building building, int slot) { - - if (slot == -1) - return new Quaternion(); - - BuildingLocation buildingLocation; - buildingLocation = _slotLocations.get(building.meshUUID).get(slot - 1); // array index - - if (buildingLocation == null) { - Logger.error("Invalid slot rotation for building: " + building.getObjectUUID()); - } - - return buildingLocation.getRotation(); - } - public static boolean playerCanManage(PlayerCharacter player, Building building) { if (player == null) From bf1271c84086baa9cc15072ebd365cda65a9f0d6 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 22 Jul 2023 10:44:36 -0400 Subject: [PATCH 2/5] Slot not rotated twice. --- src/engine/objects/Mob.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 798286fb..684809e1 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -922,11 +922,6 @@ public class Mob extends AbstractIntelligenceAgent { this.bindLoc = building.getLoc().add(slotLocation); - // Rotate MOB by slot rotation - - slotRotation = BuildingManager.getSlotLocation(building, slot).getRotation(); - this.setRot(new Vector3f(0, slotRotation.y, 0)); - } // Rotate slot position by the building rotation From 5899bb535bde027e9e914922431f166a8851c4db Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 22 Jul 2023 11:02:03 -0400 Subject: [PATCH 3/5] Stuck location rotated properly. --- src/engine/objects/Building.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index 0b058624..d625234c 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -1245,6 +1245,10 @@ public class Building extends AbstractWorldObject { stuckLocation = stuckLocations.get(ThreadLocalRandom.current().nextInt(stuckLocations.size())).getLocation(); stuckLocation = this.getLoc().add(stuckLocation); + // Rotate stuck position by the building rotation + + stuckLocation = Vector3fImmutable.rotateAroundPoint(this.getLoc(), stuckLocation, this.getBounds().getQuaternion().angleY); + return stuckLocation; } From c06bc97640c80a4fc8b0c55e56606c05a26b854b Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 22 Jul 2023 11:04:32 -0400 Subject: [PATCH 4/5] Only rotate once --- src/engine/objects/NPC.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 3cb6868a..e4851196 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -814,11 +814,6 @@ public class NPC extends AbstractCharacter { this.loc = new Vector3fImmutable(bindLoc); - // Rotate NPC by slot rotation - - slotRotation = BuildingManager.getSlotLocation(building, slot).getRotation(); - this.setRot(new Vector3f(0, slotRotation.y, 0)); - // Rotate NPC rotation by the building's rotation slotRotation = new Quaternion().fromAngles(0, acos(this.getRot().y) * 2, 0); From 7f5d5dbad2c490baf8fb454183611e152c2faaee Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 22 Jul 2023 13:07:04 -0400 Subject: [PATCH 5/5] Footprint adjusted to match mesh. --- src/engine/Enum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/Enum.java b/src/engine/Enum.java index fd419dab..ce5dfa3c 100644 --- a/src/engine/Enum.java +++ b/src/engine/Enum.java @@ -1612,7 +1612,7 @@ public class Enum { ESTATE(64f, 64f), FORTRESS(64f, 64f), CITADEL(64f, 64f), - WALLSTRAIGHTTOWER(16f, 64), + WALLSTRAIGHTTOWER(32F, 64), WALLSTAIRS(64, 64); private final Vector2f extents;