Core/Movement: Remove random direction knockbacks and instead use unit orientation (#27194)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Seyden
2021-11-06 18:11:17 +01:00
committed by GitHub
parent 6681f4770a
commit 581d514678

View File

@@ -69,9 +69,9 @@ void Position::GetSinCos(const float x, const float y, float &vsin, float &vcos)
if (std::fabs(dx) < 0.001f && std::fabs(dy) < 0.001f)
{
float angle = (float)rand_norm()*static_cast<float>(2 * M_PI);
vcos = std::cos(angle);
vsin = std::sin(angle);
float o = NormalizeOrientation(GetOrientation() - M_PI);
vcos = std::cos(o);
vsin = std::sin(o);
}
else
{