]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Juhu/scoreboard-strafe
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 27 Mar 2023 16:43:38 +0000 (18:43 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 27 Mar 2023 16:51:21 +0000 (18:51 +0200)
Fixed compile error caused by new speed unit cvar

1  2 
.gitlab-ci.yml
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/server/race.qc

diff --cc .gitlab-ci.yml
index 73b134360c2a19df608f7ec589f71d85bf02fb6d,8ba5c18061a8b807617a4ab4c6b602c2ae7c154a..6f5c8c2d5bb6a40f15d3c19c26b6b64e4a88c976
@@@ -69,7 -75,7 +75,7 @@@ test_sv_game
      - wget -nv -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints\r
      - wget -nv -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache\r
  \r
-     - EXPECT=ac76f7e463a6e7ae72992e8ff2ab88f5\r
 -    - EXPECT=fe5dec36cb304c55acee73afd1e09c0a\r
++    - EXPECT=3db0ae13a7c4437997f04036773b6b3e\r
      - HASH=$(${ENGINE} +timestamps 1 +exec serverbench.cfg\r
        | tee /dev/stderr\r
        | sed -e 's,^\[[^]]*\] ,,'\r
index 36370a7b0b6a7080a4d01608b36bb880903cd390,484968a9c39a20ebf3b380c1d90e98d6b87dbb29..d22dc5f0994933da77e86643f97b5f4fdbc5b014
@@@ -1074,23 -1070,6 +1074,23 @@@ string Scoreboard_GetField(entity pl, P
                case SP_DMG: case SP_DMGTAKEN:
                        return sprintf("%.1f k", pl.(scores(field)) / 1000);
  
-                       float speed = pl.(scores(field)) * GetSpeedUnitFactor(autocvar_hud_panel_physics_speed_unit);
 +              case SP_CTS_STRAFE:
 +              {
 +                      float strafe_efficiency = pl.(scores(field)) / 1000;
 +                      if(strafe_efficiency < -1) return "";
 +                      sbt_field_rgb = '1 1 1' - (strafe_efficiency > 0 ? '1 0 1' : '0 1 1') * fabs(strafe_efficiency);
 +                      return sprintf("%.1f%%", strafe_efficiency * 100);
 +              }
 +
 +              case SP_CTS_STARTSPEED:
 +              case SP_CTS_AVGSPEED:
 +              case SP_CTS_TOPSPEED:
 +              {
-                       return sprintf("%d%s", speed, GetSpeedUnit(autocvar_hud_panel_physics_speed_unit));
++                      float speed = pl.(scores(field)) * GetSpeedUnitFactor(autocvar_hud_speed_unit);
 +                      if(speed < 0) return "";
++                      return sprintf("%d%s", speed, GetSpeedUnit(autocvar_hud_speed_unit));
 +              }
 +
                default: case SP_SCORE:
                        tmp = pl.(scores(field));
                        f = scores_flags(field);
Simple merge