From: terencehill Date: Sun, 22 Mar 2020 12:03:04 +0000 (+0100) Subject: Don't announce frags remaining if leadlimit_and_fraglimit 1 and fraglimit 0 and leadl... X-Git-Tag: xonotic-v0.8.5~1144^2~6^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d144c8153c29556e45d8ec4be7774f68c9611e59;p=xonotic%2Fxonotic-data.pk3dir.git Don't announce frags remaining if leadlimit_and_fraglimit 1 and fraglimit 0 and leadlimit > 0 since scoring rules ignore leadlimit in this case. Basically I've just added 'if (limit)' before 'fragsleft = max(leadingfragsleft, fragsleft);', other changes are just code rearrangement. Also removed 'if (fragsleft > 3) fragsleft = 0;' as it was just an negligible optimization --- diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 89fee9051..fd8631f31 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1751,28 +1751,24 @@ float WinningCondition_Scores(float limit, float leadlimit) leaderscore = WinningConditionHelper_topscore; secondscore = WinningConditionHelper_secondscore; + if (limit) + fragsleft = limit - leaderscore; if (leadlimit) leadingfragsleft = secondscore + leadlimit - leaderscore; - if (autocvar_leadlimit_and_fraglimit && leadlimit && limit) + + if (autocvar_leadlimit_and_fraglimit && leadlimit) { - fragsleft = limit - leaderscore; - fragsleft = max(leadingfragsleft, fragsleft); + if (limit) + fragsleft = max(leadingfragsleft, fragsleft); } - else + else if (leadlimit) { if (limit) - { - fragsleft = limit - leaderscore; - if (leadlimit) - fragsleft = min(fragsleft, leadingfragsleft); - } - else if (leadlimit) + fragsleft = min(fragsleft, leadingfragsleft); + else fragsleft = leadingfragsleft; } - if (fragsleft > 3) - fragsleft = 0; - if (fragsleft_last != fragsleft) // do not announce same remaining frags multiple times { if (fragsleft == 1)