* Improve the smoothness of the turn controls.

Thanks to @Kleadron on GitHub for the hint.
This commit is contained in:
iProgramInCpp
2023-07-31 11:02:44 +03:00
parent 4735bd5cf0
commit 1a75690f52
4 changed files with 40 additions and 7 deletions

View File

@@ -498,7 +498,26 @@ void GameRenderer::render(float f)
if (!pMC->m_options.field_240)
{
// TODO
// @TODO: untangle this code
float v17 = xd + field_14;
float v18 = field_18;
float v19 = field_1C;
field_14 = v17;
float v20 = mult1 * 0.25f * (v17 - v18);
float v21 = v19 + (v20 - v19) * 0.5f;
field_1C = v21;
if ((v20 <= 0.0 || v20 <= v21) && (v20 >= 0.0 || v20 >= v21))
v21 = mult1 * 0.25f * (v17 - v18);
float v22 = yd + field_20;
field_18 = v18 + v21;
float v23 = field_24;
field_20 = v22;
float v24 = mult1 * 0.15f * (v22 - v23);
float v25 = field_28 + (v24 - field_28) * 0.5f;
field_28 = v25;
if ((v24 <= 0.0 || v24 <= v25) && (v24 >= 0.0 || v24 >= v25))
v25 = v24;
field_24 = v23 + v25;
}
pMC->m_pLocalPlayer->turn(diff_field_84 * field_7C, diff_field_84 * multPitch * field_80);