mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Fix damage direction tilt
This commit is contained in:
parent
6510f040ae
commit
7d23a82b2e
|
|
@ -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<float>(
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue