Refactor dedicated idling a little

This commit is contained in:
LJ Sonic 2024-09-06 15:50:09 +02:00
parent 8a6beee52a
commit cfb3b45ae4

View file

@ -1500,18 +1500,15 @@ void NetUpdate(void)
{ {
INT32 i; INT32 i;
for (i = 1; i < MAXNETNODES; ++i) boolean empty = true;
for (i = 1; i < MAXNETNODES; i++)
if (netnodes[i].ingame) if (netnodes[i].ingame)
{ {
if (dedicatedidle >= dedicatedidletime) empty = false;
{
CONS_Printf("DEDICATED: Awakening from idle (Node %d detected...)\n", i);
dedicatedidle = 0;
}
break; break;
} }
if (i == MAXNETNODES) if (empty)
{ {
if (leveltime == 2) if (leveltime == 2)
{ {
@ -1541,6 +1538,14 @@ void NetUpdate(void)
dedicatedidle = dedicatedidletime; dedicatedidle = dedicatedidletime;
} }
} }
else
{
if (dedicatedidle >= dedicatedidletime)
{
CONS_Printf("DEDICATED: Awakening from idle (Node detected...)\n");
dedicatedidle = 0;
}
}
} }
else else
{ {