- Improve player prediction

This commit is contained in:
Magnus Norddahl 2018-04-28 16:21:05 +02:00
parent bb235ab572
commit c89c63d9da
2 changed files with 3 additions and 1 deletions

View file

@ -159,7 +159,7 @@ ticcmd_t NetClient::GetPlayerInput(int player) const
ticcmd_t NetClient::GetSentInput(int tic) const
{
return mCurrentInput[consoleplayer];
return mSentInput[tic % BACKUPTICS];
}
void NetClient::RunCommands(int player)
@ -173,6 +173,7 @@ void NetClient::RunCommands(int player)
void NetClient::WriteLocalInput(ticcmd_t cmd)
{
mCurrentInput[consoleplayer] = cmd;
mSentInput[gametic % BACKUPTICS] = cmd;
}
void NetClient::WriteBotInput(int player, const ticcmd_t &cmd)

View file

@ -62,6 +62,7 @@ private:
int mSendTic = 0;
ticcmd_t mCurrentInput[MAXPLAYERS];
ticcmd_t mSentInput[BACKUPTICS];
FDynamicBuffer mCurrentCommands;
FDynamicBuffer mSendCommands;
};