From 7d23a82b2eb465979ccbf38c47ca0720dc0e428a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Siobhan=20=F0=9F=8F=B3=EF=B8=8F=E2=80=8D=E2=9A=A7=EF=B8=8F?= <33694155+siobhan-saoirse@users.noreply.github.com> Date: Thu, 5 Mar 2026 10:19:54 -0500 Subject: [PATCH] Fix damage direction tilt --- Minecraft.World/LivingEntity.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Minecraft.World/LivingEntity.cpp b/Minecraft.World/LivingEntity.cpp index 5f8a3dd1c..d95704565 100644 --- a/Minecraft.World/LivingEntity.cpp +++ b/Minecraft.World/LivingEntity.cpp @@ -1222,6 +1222,23 @@ void LivingEntity::handleEntityEvent(byte id) } } +void LivingEntity::lerpMotion(double xd, double yd, double zd) +{ + this->xd = xd; + this->yd = yd; + this->zd = zd; + // Set the value + float result = static_cast( + std::atan2(this->zd - zd, this->xd - xd) * (180.0 / PI) + - this->getYHeadRot() + ); + + if (std::isfinite(result)) + { + this->hurtDir = result; + } +} + void LivingEntity::outOfWorld() { hurt(DamageSource::outOfWorld, 4); @@ -2002,4 +2019,4 @@ bool LivingEntity::isAlliedTo(Team *other) return getTeam()->isAlliedTo(other); } return false; -} \ No newline at end of file +}