From f2390298ce2418799716f4e89badb5dd10827ce9 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 28 May 2023 19:57:13 +0200 Subject: [PATCH] fraglimit vote: reduce maximum votable frag limit --- qcsrc/server/command/vote.qc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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)); -- 2.39.2