From: terencehill Date: Mon, 18 Apr 2022 22:20:01 +0000 (+0200) Subject: Amend commit 222b94d2d, ReplicateVars_Start was meant to be executed only once X-Git-Tag: xonotic-v0.8.5~63 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d23c764e8ce9874d7a831a07f28ad33624e62dfc;p=xonotic%2Fxonotic-data.pk3dir.git Amend commit 222b94d2d, ReplicateVars_Start was meant to be executed only once --- diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index e5b38b768..8bd5d7863 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -437,6 +437,9 @@ void PostInit() TrueAim_Init(); + // this can't be called in CSQC_Init as it'd send cvars too early + ReplicateVars_Start(); + postinit = true; } @@ -665,9 +668,6 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew) 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) diff --git a/qcsrc/lib/replicate.qh b/qcsrc/lib/replicate.qh index 470d56aa0..e2e34b197 100644 --- a/qcsrc/lib/replicate.qh +++ b/qcsrc/lib/replicate.qh @@ -51,8 +51,11 @@ const int REPLICATEVARS_DESTROY = 1; // destroy data associated with cvars (shut } void ReplicateVars_Start() { - ReplicateVars_time = time; - ReplicateVars(REPLICATEVARS_SEND_ALL); + if (!ReplicateVars_time) // make sure it gets executed only once + { + ReplicateVars(REPLICATEVARS_SEND_ALL); + ReplicateVars_time = time; + } } #endif