From 5899bb535bde027e9e914922431f166a8851c4db Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 22 Jul 2023 11:02:03 -0400 Subject: [PATCH] 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; }