Fixed pets obstructing the view when looking up

This commit is contained in:
Auxilor
2022-07-21 16:15:17 +01:00
parent 9a7ff1760c
commit 91cf08f0ac

View File

@@ -55,7 +55,17 @@ class PetDisplay(
private fun getLocation(player: Player): Location {
val offset = player.eyeLocation.direction.clone().normalize()
.multiply(-1)
.apply { y = abs(y) }
.apply {
y = abs(y)
if (abs(x) < 0.5) {
x = 0.5
}
if (abs(z) < 0.5) {
z = 0.5
}
}
.rotateAroundY(PI / 6)
return player.eyeLocation.clone().add(offset)