X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=bf6fddf5cf3db2b75aa7b5be3baa1d05f9d22cb0;hp=fd8631f31a8657e82d664149f6ba16c83b729b7d;hb=016835f8f51aff29719995f8d080d9c1b19392c4;hpb=bb906a90d48e861dcf677e7e1537d8f75d5033b0 diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index fd8631f31..bf6fddf5c 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1710,8 +1710,6 @@ float secondscore; int fragsleft_last; float WinningCondition_Scores(float limit, float leadlimit) { - float limitreached; - // TODO make everything use THIS winning condition (except LMS) WinningConditionHelper(NULL); @@ -1783,24 +1781,17 @@ float WinningCondition_Scores(float limit, float leadlimit) } } - limitreached = false; - if (limit && WinningConditionHelper_topscore >= limit) - limitreached = true; - if(leadlimit) - { - float leadlimitreached; - leadlimitreached = (WinningConditionHelper_topscore - WinningConditionHelper_secondscore >= leadlimit); - if(autocvar_leadlimit_and_fraglimit) - limitreached = (limitreached && leadlimitreached); - else - limitreached = (limitreached || leadlimitreached); - } + bool fraglimit_reached = (limit && WinningConditionHelper_topscore >= limit); + bool leadlimit_reached = (WinningConditionHelper_topscore - WinningConditionHelper_secondscore >= leadlimit); - if(limit) - game_completion_ratio = max(game_completion_ratio, bound(0, WinningConditionHelper_topscore / limit, 1)); + bool limit_reached; + if(autocvar_leadlimit_and_fraglimit) + limit_reached = (fraglimit_reached && leadlimit_reached); + else + limit_reached = (fraglimit_reached || leadlimit_reached); return GetWinningCode( - WinningConditionHelper_topscore && limitreached, + WinningConditionHelper_topscore && limit_reached, WinningConditionHelper_equality ); } @@ -1891,10 +1882,6 @@ Exit deathmatch games upon conditions */ void CheckRules_World() { - float timelimit; - float fraglimit; - float leadlimit; - VoteThink(); MapVote_Think(); @@ -1909,9 +1896,10 @@ void CheckRules_World() return; } - timelimit = autocvar_timelimit * 60; - fraglimit = autocvar_fraglimit; - leadlimit = autocvar_leadlimit; + float timelimit = autocvar_timelimit * 60; + float fraglimit = autocvar_fraglimit; + float leadlimit = autocvar_leadlimit; + if (leadlimit < 0) leadlimit = 0; if(warmup_stage || time <= game_starttime) // NOTE: this is <= to prevent problems in the very tic where the game starts { @@ -1936,11 +1924,6 @@ void CheckRules_World() float wantovertime; wantovertime = 0; - if(timelimit > game_starttime) - game_completion_ratio = (time - game_starttime) / (timelimit - game_starttime); - else - game_completion_ratio = 0; - if(checkrules_suddendeathend) { if(!checkrules_suddendeathwarning)