From: terencehill Date: Fri, 12 Mar 2021 11:13:07 +0000 (+0100) Subject: Remove redundant SVQC check; avoid duplicated field definitions in Race GameRules_scoring X-Git-Tag: xonotic-v0.8.5~512^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ad9ccc3b319b42b60cff4ef029fdf57c032f87d5;p=xonotic%2Fxonotic-data.pk3dir.git Remove redundant SVQC check; avoid duplicated field definitions in Race GameRules_scoring --- diff --git a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc index 74929ebd1..ecfd36605 100644 --- a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc @@ -53,20 +53,18 @@ void havocbot_role_race(entity this) void race_ScoreRules() { - GameRules_score_enabled(false); + GameRules_score_enabled(false); GameRules_scoring(race_teams, 0, 0, { - if (race_teams) { - field_team(ST_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY); - field(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY); - field(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME); - field(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME); - } else if (g_race_qualifying) { - field(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME); - } else { - field(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY); - field(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME); - field(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME); - } + if (race_teams) + field_team(ST_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY); + else if (g_race_qualifying) + field(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME); + if (race_teams || !g_race_qualifying) + { + field(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY); + field(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME); + field(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME); + } }); } @@ -139,7 +137,6 @@ MUTATOR_HOOKFUNCTION(rc, PlayerPhysics) player.race_movetime_count += f; player.race_movetime = player.race_movetime_frac + player.race_movetime_count; -#ifdef SVQC if(IS_PLAYER(player)) { if (player.race_penalty) @@ -152,7 +149,6 @@ MUTATOR_HOOKFUNCTION(rc, PlayerPhysics) player.disableclientprediction = 2; } } -#endif // force kbd movement for fairness float wishspeed; @@ -441,8 +437,8 @@ void rc_SetLimits() } else g_race_qualifying = 0; - GameRules_limit_score(fraglimit_override); - GameRules_limit_lead(leadlimit_override); - GameRules_limit_time(timelimit_override); - GameRules_limit_time_qualifying(qualifying_override); + GameRules_limit_score(fraglimit_override); + GameRules_limit_lead(leadlimit_override); + GameRules_limit_time(timelimit_override); + GameRules_limit_time_qualifying(qualifying_override); }