]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Display a +0.00 race diff in yellow 1501/head
authorotta8634 <k9wolf@pm.me>
Wed, 7 May 2025 13:33:08 +0000 (21:33 +0800)
committerotta8634 <k9wolf@pm.me>
Wed, 7 May 2025 13:35:33 +0000 (21:35 +0800)
Previously this part of a notification would be shown in green as -0.00, despite the record evidently not being broken.
It now displays +0.0 in yellow.

qcsrc/common/notifications/all.qh

index 8f5d7f24656341b2a99fca1b732c3d836f60663b..12b6d63bc2f8146160f3c39944156bc9ae2cea82 100644 (file)
@@ -459,7 +459,7 @@ string BUFF_NAME(int i);
        ARG_CASE(ARG_CS_SV_HA,  "f2race_time",   TIME_ENCODED_TOSTRING(f2, true)) \
        ARG_CASE(ARG_CS_SV_HA,  "f3race_time",   TIME_ENCODED_TOSTRING(f3, true)) \
        ARG_CASE(ARG_CS_SV,     "race_col",      CCR((f1 == 1) ? "^F1" : "^F2")) \
-       ARG_CASE(ARG_CS_SV,     "race_diff",     ((f2 > f3) ? sprintf("^1[+%s]", TIME_ENCODED_TOSTRING(f2 - f3, true)) : sprintf("^2[-%s]", TIME_ENCODED_TOSTRING(f3 - f2, true)))) \
+       ARG_CASE(ARG_CS_SV,     "race_diff",     ((TIME_ENCODED_TOSTRING(fabs(f2 - f3), true) == "0.00") ? "^3[+0.0]" : (f2 > f3) ? sprintf("^1[+%s]", TIME_ENCODED_TOSTRING(f2 - f3, true)) : sprintf("^2[-%s]", TIME_ENCODED_TOSTRING(f3 - f2, true)))) \
        ARG_CASE(ARG_CS,        "missing_teams", notif_arg_missing_teams(f1)) \
        ARG_CASE(ARG_CS,        "pass_key",      getcommandkey(_("drop flag"), "+use")) \
        ARG_CASE(ARG_CS,        "nade_key",      getcommandkey(_("throw nade"), "dropweapon")) \