diff --git a/source/games/exhumed/src/grenade.cpp b/source/games/exhumed/src/grenade.cpp index e18164ca7..4168ef7d0 100644 --- a/source/games/exhumed/src/grenade.cpp +++ b/source/games/exhumed/src/grenade.cpp @@ -86,7 +86,7 @@ void ThrowGrenade(int nPlayer, double dz, double push1) if (push1 <= 23.4375) { - int nVel = PlayerList[nPlayer].totalvel << 5; + int nVel = (int)(PlayerList[nPlayer].totalvel * 512.); pActor->nTurn = ((90 - pActor->nIndex2) * (90 - pActor->nIndex2)) + nVel; pActor->vel.Z = ((32. * push1) - 17); diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index 513360581..70891d674 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -946,8 +946,8 @@ void DrawWeapons(Player* const pPlayer, double interpfrac) nTotalVel = interpolatedvalue(pPlayer->ototalvel, pPlayer->totalvel, interpfrac); } - const auto xBob = nTotalVel * BobVal(nBobAngle + 512) * (1. / 16.) * (nState == 1); - const auto yBob = nTotalVel * fabs(BobVal(nBobAngle)) * (1. / 16.); + const auto xBob = nTotalVel * BobVal(nBobAngle + 512) * (nState == 1); + const auto yBob = nTotalVel * fabs(BobVal(nBobAngle)); nFlameAng += xBob; xPos += xBob * 2.; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 6a6d86d5b..4aae9be43 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -1258,7 +1258,7 @@ static void updatePlayerAction(Player* const pPlayer, const bool bUnderwater) else { scaleViewZ(-32.5); - nextAction = 7 - (pPlayer->totalvel < 1); + nextAction = 7 - (pPlayer->totalvel < 0.0625); } } else @@ -1286,17 +1286,17 @@ static void updatePlayerAction(Player* const pPlayer, const bool bUnderwater) if (bUnderwater) { - nextAction = 10 - (pPlayer->totalvel <= 1); + nextAction = 10 - (pPlayer->totalvel <= 0.0625); } else if (bTallerThanSector) { - nextAction = 7 - (pPlayer->totalvel < 1); + nextAction = 7 - (pPlayer->totalvel < 0.0625); } - else if (pPlayer->totalvel <= 1) + else if (pPlayer->totalvel <= 0.0625) { nextAction = bUnderwater; } - else if (pPlayer->totalvel <= 30) + else if (pPlayer->totalvel <= 1.875) { nextAction = 2; } @@ -1321,7 +1321,7 @@ static void updatePlayerAction(Player* const pPlayer, const bool bUnderwater) } else if (pPlayerActor->nAction != 15) { - nextAction = 14 - (pPlayer->totalvel <= 1); + nextAction = 14 - (pPlayer->totalvel <= 0.0625); } if (nextAction != pPlayerActor->nAction && pPlayerActor->nAction != 4) @@ -1477,7 +1477,7 @@ static void doPlayerUnderwater(Player* const pPlayer, const bool oUnderwater) else { const auto pPlayerSect = pPlayerActor->sector(); - const auto highSpeed = pPlayer->totalvel > 25; + const auto highSpeed = pPlayer->totalvel > 1.5625; const auto belowFloor = pPlayerActor->spr.pos.Z > pPlayerSect->floorz; if (highSpeed && belowFloor && pPlayerSect->Depth && !pPlayerSect->Speed && !pPlayerSect->Damage) @@ -1833,7 +1833,7 @@ static bool doPlayerInput(Player* const pPlayer) const auto posdelta = pPlayerActor->opos - pPlayerActor->spr.pos; pPlayer->ototalvel = pPlayer->totalvel; - pPlayer->totalvel = int(posdelta.XY().Length() * worldtoint); + pPlayer->totalvel = posdelta.XY().Length(); // Effects such as slope tilting, view bobbing, etc. // This should amplified 8x, not 2x, but it feels very heavy. Add a CVAR? diff --git a/source/games/exhumed/src/player.h b/source/games/exhumed/src/player.h index e1a1bf34e..0069c51ba 100644 --- a/source/games/exhumed/src/player.h +++ b/source/games/exhumed/src/player.h @@ -97,8 +97,8 @@ struct Player int16_t nTemperature; double nStandHeight; PlayerSave sPlayerSave; - int ototalvel; - int totalvel; + double ototalvel; + double totalvel; bool crouch_toggle; bool bTouchFloor; bool bJumping;