mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- Exhumed: Increase precision of Player::totalvel
.
This commit is contained in:
parent
e0964eef7a
commit
8283895828
4 changed files with 13 additions and 13 deletions
|
@ -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);
|
||||
|
|
|
@ -946,8 +946,8 @@ void DrawWeapons(Player* const pPlayer, double interpfrac)
|
|||
nTotalVel = interpolatedvalue<double>(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.;
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue