From: terencehill Date: Fri, 9 Apr 2021 14:27:47 +0000 (+0200) Subject: Fix #2575 "FPS field no longer displayed in scoreboard with sv_showfps set" X-Git-Tag: xonotic-v0.8.5~456 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9b48bd9cab8b4f8caa2d5b385597d8169ec56aef;p=xonotic%2Fxonotic-data.pk3dir.git Fix #2575 "FPS field no longer displayed in scoreboard with sv_showfps set" --- diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 6f41ae9ee..58a1093b9 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -464,9 +464,6 @@ void Cmd_Scoreboard_SetFields(int argc) } str = strtolower(str); - if(!STAT(SHOWFPS) && str == "fps") - continue; - strcpy(sbt_field_title[sbt_num_fields], TranslateScoresLabel(str)); sbt_field_size[sbt_num_fields] = stringwidth(sbt_field_title[sbt_num_fields], false, hud_fontsize); @@ -482,7 +479,6 @@ void Cmd_Scoreboard_SetFields(int argc) case "elo": sbt_field[sbt_num_fields] = SP_ELO; break; case "dmg": case "damage": sbt_field[sbt_num_fields] = SP_DMG; break; case "dmgtaken": case "damagetaken": sbt_field[sbt_num_fields] = SP_DMGTAKEN; break; - case "fps": sbt_field[sbt_num_fields] = SP_FPS; break; default: { FOREACH(Scores, true, { @@ -497,8 +493,12 @@ LABEL(notfound) j = SP_FRAGS; else { - if(!nocomplain) + // 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)