]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move the "frags" check to the right place (the SP_FRAGS scoreboard field isn't networ...
authorterencehill <piuntn@gmail.com>
Tue, 13 Apr 2021 12:23:12 +0000 (14:23 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 13 Apr 2021 12:23:12 +0000 (14:23 +0200)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/scores.qh

index 559efbc569fedab71e6ead103c848d60676fbddc..43ebc2e3ff95c03294023cbc039e6c63d44af4db 100644 (file)
@@ -473,10 +473,11 @@ void Cmd_Scoreboard_SetFields(int argc)
                        // fields without a label (not networked)
                        case "ping": sbt_field[sbt_num_fields] = SP_PING; break;
                        case "pl": sbt_field[sbt_num_fields] = SP_PL; break;
-                       case "kd": case "kdr": case "kdratio": sbt_field[sbt_num_fields] = SP_KDRATIO; break;
-                       case "sum": case "diff": case "k-d": sbt_field[sbt_num_fields] = SP_SUM; break;
                        case "name": case "nick": sbt_field[sbt_num_fields] = SP_NAME; have_name = true; break;
                        case "|": sbt_field[sbt_num_fields] = SP_SEPARATOR; have_separator = true; break;
+                       case "kd": case "kdr": case "kdratio": sbt_field[sbt_num_fields] = SP_KDRATIO; break;
+                       case "sum": case "diff": case "k-d": sbt_field[sbt_num_fields] = SP_SUM; break;
+                       case "frags": sbt_field[sbt_num_fields] = SP_FRAGS; break;
                        default: // fields with a label
                        {
                                // map alternative labels
@@ -490,20 +491,15 @@ void Cmd_Scoreboard_SetFields(int argc)
                                        }
                                });
 
-LABEL(notfound)
-                               if(str == "frags")
-                                       j = SP_FRAGS;
-                               else
-                               {
-                                       // NOTE: can't check STAT(SHOWFPS) here, if checked too early it returns false anyway
-                                       if(!nocomplain && str != "fps") // server can disable the fps field
-                                               LOG_INFOF("^1Error:^7 Unknown score field: '%s'", str);
+                               // NOTE: can't check STAT(SHOWFPS) here, if checked too early it returns false anyway
+                               if(!nocomplain && str != "fps") // server can disable the fps field
+                                       LOG_INFOF("^1Error:^7 Unknown score field: '%s'", str);
 
-                                       strfree(sbt_field_title[sbt_num_fields]);
-                                       sbt_field_size[sbt_num_fields] = 0;
-                                       continue;
-                               }
-LABEL(found)
+                               strfree(sbt_field_title[sbt_num_fields]);
+                               sbt_field_size[sbt_num_fields] = 0;
+                               continue;
+
+                               LABEL(found)
                                sbt_field[sbt_num_fields] = j;
                                if(j == ps_primary)
                                        have_primary = true;
index 3bc6c55636c65fa4e3875d0bf2b328e0f3a0aa02..39510dd9f7fba5d7934df0d1b1d431f907aabf7b 100644 (file)
@@ -17,16 +17,20 @@ STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); }
 
 // game mode specific indices are not in common/, but in server/scores_rules.qc!
 #ifdef GAMEQC
+// non-networked fields (client only, even though they are defined in the server too)
 REGISTER_SP(END);
 
 REGISTER_SP(PING);
 REGISTER_SP(PL);
 REGISTER_SP(NAME);
-REGISTER_SP(KDRATIO);
-REGISTER_SP(SUM);
-
 REGISTER_SP(SEPARATOR);
 
+REGISTER_SP(KDRATIO); // kills / deaths
+REGISTER_SP(SUM); // kills - deaths
+REGISTER_SP(FRAGS); // kills - suicides
+
+// networked fields
+
 REGISTER_SP(SCORE);
 
 REGISTER_SP(DMG);
@@ -36,7 +40,6 @@ REGISTER_SP(KILLS);
 REGISTER_SP(DEATHS);
 REGISTER_SP(SUICIDES);
 REGISTER_SP(TEAMKILLS);
-REGISTER_SP(FRAGS);
 
 REGISTER_SP(ELO);