]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/main.qc
Refactor Nagger_SendEntity and Net_Handle_ENT_CLIENT_NAGGER
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qc
index 69214ee8a9877e9a1a74d92f217f6e9bb74bf261..689618fd116712f79ca9bc09191949d7a190e479 100644 (file)
@@ -526,7 +526,7 @@ float CSQC_InputEvent(int bInputType, float nPrimary, float nSecondary)
                        Scoreboard_UI_Enable(0);
                        return true;
                }
-               if (!isdemo() && cvar("_menu_gamemenu_dialog_available"))
+               if (autocvar_menu_gamemenu && !isdemo() && cvar("_menu_gamemenu_dialog_available"))
                {
                        localcmd("\nmenu_showgamemenudialog\n");
                        return true;
@@ -657,6 +657,7 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
                newspectatee_status = 0;
 
        spectatorbutton_zoom = (f & BIT(2));
+       observe_blocked = (f & BIT(3));
 
        if(f & BIT(4))
        {
@@ -708,7 +709,6 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
 NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)
 {
        make_pure(this);
-       int i, j, b, f;
 
        int nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS
 
@@ -735,20 +735,11 @@ NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)
                strcpy(vote_called_vote, ReadString());
        }
 
-       if(nags & 1)
-       {
-               for(j = 0; j < maxclients; ++j)
-                       if(playerslots[j])
-                               playerslots[j].ready = true;
-               for(i = 1; i <= maxclients; i += 8)
-               {
-                       f = ReadByte();
-                       for(j = i-1, b = BIT(0); b < BIT(8); b <<= 1, ++j)
-                               if (!(f & b))
-                                       if(playerslots[j])
-                                               playerslots[j].ready = false;
-               }
-       }
+       if(nags & BIT(0))
+               for(int i = 0; i < maxclients;)
+                       for(int f = ReadByte(), b = 0; b < 8 && i < maxclients; ++b, ++i)
+                               if(playerslots[i])
+                                       playerslots[i].ready = f & BIT(b);
 
        return = true;
 
@@ -1403,7 +1394,7 @@ string GetVersionMessage(string hostversion, bool version_mismatch, bool version
 
 bool net_handle_ServerWelcome()
 {
-       bool campaign = ReadByte();
+       campaign = ReadByte();
        if (campaign)
        {
                string campaign_title = ReadString();