From 8147ff449c2a205f054723cb8773f36ee1e776a0 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 2 Jul 2010 00:52:20 +0200 Subject: [PATCH] In case timelimit is 0 (infinite) do not allow extendmatchtime to increase timelimit, therefore making it finite. Still in this case, do not allow to call a vote for extendmatchtime or reducematchtime, as they don't do anything anyway. --- defaultXonotic.cfg | 2 +- qcsrc/server/vote.qc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 950a8e116..f5e2b3ed2 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1368,7 +1368,7 @@ set timelimit_increment 5 set timelimit_decrement 5 set timelimit_min 5 set timelimit_max 60 -alias extendmatchtime "sv_cmd rpn /timelimit timelimit timelimit_max timelimit timelimit_increment add bound def" +alias extendmatchtime "sv_cmd rpn /timelimit timelimit timelimit_max 0 timelimit when timelimit timelimit_increment add bound def" alias reducematchtime "sv_cmd rpn /timelimit timelimit timelimit_decrement sub timelimit_min timelimit bound def" alias endmatch "timelimit -1" diff --git a/qcsrc/server/vote.qc b/qcsrc/server/vote.qc index 338d98476..07b71d999 100644 --- a/qcsrc/server/vote.qc +++ b/qcsrc/server/vote.qc @@ -165,6 +165,8 @@ float GameCommand_Vote(string s, entity e) { print_to(e, strcat("^1You have to wait ^2", ftos(ceil(e.vote_next - time)), "^1 seconds before you can again call a vote.")); } else if(VoteCheckNasty(vote)) { print_to(e, "Syntax error in command. See 'vhelp' for more info."); + } else if(cvar("timelimit") == 0 && (vote == "extendmatchtime" || vote == "reducematchtime")) { + print_to(e, "^1Match time can not be reduced or extended as it is infinite. See 'vhelp' for more info."); } else if(RemapVote(vote, "vcall", e)) { votecalledvote = strzone(RemapVote_vote); votecalledvote_display = strzone(RemapVote_display); @@ -203,7 +205,7 @@ float GameCommand_Vote(string s, entity e) { VoteDialog_Reset(); VoteStop(e); } else { - print_to(e, "^1You are not allowed to stop that Vote."); + print_to(e, "^1You are not allowed to stop that vote."); } } else if(argv(1) == "master") { if(cvar("sv_vote_master")) { -- 2.39.2