mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-24 13:21:20 +00:00
Fix lastinputtime not incrementing if idletime is 0
This commit is contained in:
parent
32bbc48be5
commit
06949628cf
1 changed files with 3 additions and 3 deletions
|
@ -1361,16 +1361,16 @@ static void IdleUpdate(void)
|
||||||
if (!server || !netgame)
|
if (!server || !netgame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 1; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (cv_idletime.value && playeringame[i] && playernode[i] != UINT8_MAX && !players[i].quittime && !players[i].spectator && !players[i].bot && !IsPlayerAdmin(i) && i != serverplayer && gamestate == GS_LEVEL && !(players[i].pflags & PF_FINISHED))
|
if (playeringame[i] && playernode[i] != UINT8_MAX && !players[i].quittime && !players[i].spectator && !players[i].bot && gamestate == GS_LEVEL)
|
||||||
{
|
{
|
||||||
if (players[i].cmd.forwardmove || players[i].cmd.sidemove || players[i].cmd.buttons)
|
if (players[i].cmd.forwardmove || players[i].cmd.sidemove || players[i].cmd.buttons)
|
||||||
players[i].lastinputtime = 0;
|
players[i].lastinputtime = 0;
|
||||||
else
|
else
|
||||||
players[i].lastinputtime++;
|
players[i].lastinputtime++;
|
||||||
|
|
||||||
if (players[i].lastinputtime > (tic_t)cv_idletime.value * TICRATE * 60)
|
if (cv_idletime.value && !IsPlayerAdmin(i) && i != serverplayer && !(players[i].pflags & PF_FINISHED) && players[i].lastinputtime > (tic_t)cv_idletime.value * TICRATE * 60)
|
||||||
{
|
{
|
||||||
players[i].lastinputtime = 0;
|
players[i].lastinputtime = 0;
|
||||||
if (cv_idlespectate.value && G_GametypeHasSpectators())
|
if (cv_idlespectate.value && G_GametypeHasSpectators())
|
||||||
|
|
Loading…
Reference in a new issue