Fix dedicated server extra lua variables not being synched for joiners

This commit is contained in:
Latapostrophe 2019-02-18 22:19:28 +01:00
parent a1aff2ec9f
commit 2b61d81011

View file

@ -1020,7 +1020,7 @@ void LUA_Archive(void)
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
if (!playeringame[i]) if (!playeringame[i] && i > 0) // NEVER skip player 0, this is for dedi servs.
continue; continue;
// all players in game will be archived, even if they just add a 0. // all players in game will be archived, even if they just add a 0.
ArchiveExtVars(&players[i], "player"); ArchiveExtVars(&players[i], "player");
@ -1056,7 +1056,7 @@ void LUA_UnArchive(void)
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
if (!playeringame[i]) if (!playeringame[i] && i > 0) // same here, this is to synch dediservs properly.
continue; continue;
UnArchiveExtVars(&players[i]); UnArchiveExtVars(&players[i]);
} }