mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-30 22:50:51 +00:00
Refactor code after review comments
This commit is contained in:
parent
a8fe500d0e
commit
436de21808
3 changed files with 6 additions and 6 deletions
|
@ -607,6 +607,7 @@ typedef struct player_s
|
|||
|
||||
tic_t jointime; // Timer when player joins game to change skin/color
|
||||
tic_t quittime; // Time elapsed since user disconnected, zero if connected
|
||||
tic_t lastinputtime; // the last tic the player has made any input
|
||||
#ifdef HWRENDER
|
||||
fixed_t fovadd; // adjust FOV for hw rendering
|
||||
#endif
|
||||
|
|
|
@ -1282,19 +1282,19 @@ static void IdleUpdate(void)
|
|||
|
||||
for (i = 1; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (cv_idletime.value && playeringame[i] && playernode[i] != UINT8_MAX && !players[i].quittime && !players[i].spectator && i != serverplayer)
|
||||
if (cv_idletime.value && playeringame[i] && playernode[i] != UINT8_MAX && !players[i].quittime && !players[i].spectator && !IsPlayerAdmin(i))
|
||||
{
|
||||
if (players[i].cmd.forwardmove || players[i].cmd.sidemove || players[i].cmd.buttons)
|
||||
netnodes[i].lastinput = gametime;
|
||||
players[i].lastinputtime = gametime;
|
||||
|
||||
if (gametime - netnodes[i].lastinput > cv_idletime.value * TICRATE)
|
||||
if (gametime - players[i].lastinputtime > (tic_t)cv_idletime.value * TICRATE * 60)
|
||||
{
|
||||
netnodes[i].lastinput = gametime;
|
||||
players[i].lastinputtime = gametime;
|
||||
SendKick(i, KICK_MSG_IDLE | KICK_MSG_KEEP_BODY);
|
||||
}
|
||||
}
|
||||
else
|
||||
netnodes[i].lastinput = gametime;
|
||||
players[i].lastinputtime = gametime;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ typedef struct netnode_s
|
|||
{
|
||||
boolean ingame; // set false as nodes leave game
|
||||
tic_t freezetimeout; // Until when can this node freeze the server before getting a timeout?
|
||||
tic_t lastinput; // the last tic the player has made any input
|
||||
|
||||
SINT8 player;
|
||||
SINT8 player2; // say the numplayer for this node if any (splitscreen)
|
||||
|
|
Loading…
Reference in a new issue