Stuck location rotated properly.

This commit is contained in:
2023-07-22 11:02:03 -04:00
parent bf1271c840
commit 5899bb535b
+4
View File
@@ -1245,6 +1245,10 @@ public class Building extends AbstractWorldObject {
stuckLocation = stuckLocations.get(ThreadLocalRandom.current().nextInt(stuckLocations.size())).getLocation(); stuckLocation = stuckLocations.get(ThreadLocalRandom.current().nextInt(stuckLocations.size())).getLocation();
stuckLocation = this.getLoc().add(stuckLocation); stuckLocation = this.getLoc().add(stuckLocation);
// Rotate stuck position by the building rotation
stuckLocation = Vector3fImmutable.rotateAroundPoint(this.getLoc(), stuckLocation, this.getBounds().getQuaternion().angleY);
return stuckLocation; return stuckLocation;
} }