From: terencehill Date: Sun, 28 May 2023 17:57:13 +0000 (+0200) Subject: fraglimit vote: reduce maximum votable frag limit X-Git-Tag: xonotic-v0.8.6~20^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f2390298ce2418799716f4e89badb5dd10827ce9;p=xonotic%2Fxonotic-data.pk3dir.git fraglimit vote: reduce maximum votable frag limit --- diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index ecf5dc997..860794653 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -821,6 +821,23 @@ int VoteCommand_parse(entity caller, string vote_command, string vote_list, floa break; } + case "fraglimit": // include restrictions on the maximum votable frag limit + { + float fraglimit_vote = stof(argv(startpos + 1)); + float fraglimit_min = 0; + float fraglimit_max = 999999; + if(fraglimit_vote > fraglimit_max || fraglimit_vote < fraglimit_min) + { + print_to(caller, strcat("Invalid fraglimit vote, accepted values are between ", ftos(fraglimit_min), " and ", ftos(fraglimit_max), ".")); + return -1; + } + fraglimit_vote = bound(fraglimit_min, fraglimit_vote, fraglimit_max); + vote_parsed_command = strcat("fraglimit ", ftos(fraglimit_vote)); + vote_parsed_display = strzone(strcat("^1", vote_parsed_command)); + + break; + } + case "timelimit": // include restrictions on the maximum votable time limit { float timelimit_vote = stof(argv(startpos + 1));