From: bones_was_here Date: Tue, 6 Aug 2024 05:14:09 +0000 (+1000) Subject: HUD: don't draw panels needing player data before it's received X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6f759bfe04c5741b577562489181ca407a7f0bc6;p=xonotic%2Fxonotic-data.pk3dir.git HUD: don't draw panels needing player data before it's received Fixes "client VM warning: VM_CL_getstati: index(-1) is >=MAX_CL_STATS(256) or <0" often appearing when connecting, with my hud_panel_ammo config. It could also have been fixed by checking for (ammoType == 0) as well as (ammoType == RES_NONE) but a many-cases fix is better than a special-case fix. --- diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index e59300a7c..954691779 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -651,7 +651,7 @@ NET_HANDLE(ENT_CLIENT_TEAMSCORES, bool isnew) NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew) { make_pure(this); - float newspectatee_status; + int newspectatee_status; int f = ReadByte(); diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index d4d97dc83..e7972edc4 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -186,7 +186,7 @@ int binddb; // -1 - observing // 0 - playing // >0 - id of spectated player -float spectatee_status; +int spectatee_status = -1; ///< the -1 disables HUD panels before CSQC receives necessary data float spectatee_status_changed_time; #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)