It fixes issue https://gitlab.com/xonotic/xonstat-go/-/issues/44 that was due to .playerstats_id getting wrongly set to "Player#0" because .playerid was not initialized yet (0)
maxclients = i;
}
- ReplicateVars(REPLICATEVARS_SEND_ALL);
-
// needs to be done so early because of the constants they create
static_init();
static_init_late();
spectatee_status = newspectatee_status;
// we could get rid of spectatee_status, and derive it from player_localentnum and player_localnum
+
+ // this can't be called in CSQC_Init as it'd send cvars too early
+ ReplicateVars_Start();
}
NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)
void PlayerStats_GameReport_FinalizePlayer(entity p);
// call this at the end of the match
-void PlayerStats_GameReport(float finished);
+void PlayerStats_GameReport(bool finished);
void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
noref float ReplicateVars_time;
ACCUMULATE void ReplicateVars(int mode)
{
- if (time < ReplicateVars_time)
+ if (!ReplicateVars_time || time < ReplicateVars_time)
return;
ReplicateVars_time = time + 0.8 + random() * 0.4; // check cvars periodically
}
+ void ReplicateVars_Start()
+ {
+ ReplicateVars_time = time;
+ ReplicateVars(REPLICATEVARS_SEND_ALL);
+ }
#endif
#define REPLICATE_3(fld, type, var) REPLICATE_4(fld, type, var, )