RR: Move lastInputTicks from DukePlayer_t struct to PlayerData_t struct.

Better location for it since it never needs to be sent across the wire in a multiplayer situation. It's now also located where the other properties to do with input being tied to frame-rate are located.
This commit is contained in:
Mitchell Richters 2020-05-14 07:38:15 +10:00 committed by Christoph Oelckers
parent 1f807792af
commit 10142eee6b
3 changed files with 11 additions and 10 deletions

View file

@ -3273,9 +3273,9 @@ void P_GetInput(int const playerNum)
input.fvel -= info.dz * keyMove / analogExtent; input.fvel -= info.dz * keyMove / analogExtent;
auto const currentHiTicks = timerGetHiTicks(); auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - pPlayer->lastInputTicks; double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
pPlayer->lastInputTicks = currentHiTicks; thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks) if (elapsedInputTicks == currentHiTicks)
return; return;
@ -3671,9 +3671,9 @@ void P_GetInputMotorcycle(int playerNum)
input.fvel -= info.dz * keyMove / analogExtent; input.fvel -= info.dz * keyMove / analogExtent;
auto const currentHiTicks = timerGetHiTicks(); auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - pPlayer->lastInputTicks; double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
pPlayer->lastInputTicks = currentHiTicks; thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks) if (elapsedInputTicks == currentHiTicks)
return; return;
@ -3925,9 +3925,9 @@ void P_GetInputBoat(int playerNum)
input.fvel -= info.dz * keyMove / analogExtent; input.fvel -= info.dz * keyMove / analogExtent;
auto const currentHiTicks = timerGetHiTicks(); auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - pPlayer->lastInputTicks; double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
pPlayer->lastInputTicks = currentHiTicks; thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks) if (elapsedInputTicks == currentHiTicks)
return; return;
@ -4190,9 +4190,9 @@ void P_DHGetInput(int const playerNum)
input.fvel -= info.dz * keyMove / analogExtent; input.fvel -= info.dz * keyMove / analogExtent;
auto const currentHiTicks = timerGetHiTicks(); auto const currentHiTicks = timerGetHiTicks();
double const elapsedInputTicks = currentHiTicks - pPlayer->lastInputTicks; double const elapsedInputTicks = currentHiTicks - thisPlayer.lastInputTicks;
pPlayer->lastInputTicks = currentHiTicks; thisPlayer.lastInputTicks = currentHiTicks;
if (elapsedInputTicks == currentHiTicks) if (elapsedInputTicks == currentHiTicks)
return; return;

View file

@ -223,7 +223,7 @@ typedef struct {
int32_t drug_timer; int32_t drug_timer;
int32_t sea_sick; int32_t sea_sick;
uint8_t hurt_delay2, nocheat; uint8_t hurt_delay2, nocheat;
double tilt_status, lastInputTicks; double tilt_status;
int32_t dhat60f, dhat613, dhat617, dhat61b, dhat61f; int32_t dhat60f, dhat613, dhat617, dhat61b, dhat61f;
@ -242,6 +242,7 @@ typedef struct
int8_t horizSkew; int8_t horizSkew;
bool lookLeft; bool lookLeft;
bool lookRight; bool lookRight;
double lastInputTicks;
int32_t movefifoend, syncvalhead, myminlag; int32_t movefifoend, syncvalhead, myminlag;
int32_t pcolor, pteam; int32_t pcolor, pteam;

View file

@ -2471,7 +2471,7 @@ int G_EnterLevel(int gameMode)
renderFlushPerms(); renderFlushPerms();
// reset lastInputTicks. // reset lastInputTicks.
g_player[myconnectindex].ps->lastInputTicks = 0; g_player[myconnectindex].lastInputTicks = 0;
everyothertime = 0; everyothertime = 0;
g_globalRandom = 0; g_globalRandom = 0;