- Exhumed: Correctly transform player velocities when running on single 30Hz timer.

Thanks, Graf :)

# Conflicts:
#	source/exhumed/src/exhumed.cpp
This commit is contained in:
Mitchell Richters 2020-08-26 19:47:45 +10:00 committed by Christoph Oelckers
parent 0c300c181f
commit e3fe1b2b60
1 changed files with 8 additions and 4 deletions

View File

@ -488,10 +488,14 @@ void GameTicker()
nPlayerDAng = fix16_sadd(nPlayerDAng, localInput.q16avel);
inita &= kAngleMask;
lPlayerXVel += localInput.fvel * Cos(inita) + localInput.svel * Sin(inita);
lPlayerYVel += localInput.fvel * Sin(inita) - localInput.svel * Cos(inita);
lPlayerXVel -= (lPlayerXVel >> 5) + (lPlayerXVel >> 6);
lPlayerYVel -= (lPlayerYVel >> 5) + (lPlayerYVel >> 6);
int i;
for (i = 0; i < 4; i++)
{
lPlayerXVel += localInput.fvel * Cos(inita) + localInput.svel * Sin(inita);
lPlayerYVel += localInput.fvel * Sin(inita) - localInput.svel * Cos(inita);
lPlayerXVel -= (lPlayerXVel >> 5) + (lPlayerXVel >> 6);
lPlayerYVel -= (lPlayerYVel >> 5) + (lPlayerYVel >> 6);
}
sPlayerInput[nLocalPlayer].xVel = lPlayerXVel;
sPlayerInput[nLocalPlayer].yVel = lPlayerYVel;