X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fvote.qc;h=f98242ad668166f3089c15ada94bc0b774ecfd58;hb=06a08d0c6b573f2562297147171aff3d990fa42d;hp=90073beaaa2273e33a876264a85358aa71ac1b4e;hpb=e928607ec4292b2b548afad0304d5830792bc485;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 90073beaa..f98242ad6 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -1,6 +1,7 @@ #include "vote.qh" #include +#include #include #include @@ -476,7 +477,7 @@ void ReadyRestart_force() void ReadyRestart() { - if (MUTATOR_CALLHOOK(ReadyRestart_Deny) || game_stopped || race_completing) localcmd("restart\n"); + if (MUTATOR_CALLHOOK(ReadyRestart_Deny) || intermission_running || race_completing) localcmd("restart\n"); else localcmd("\nsv_hook_readyrestart\n"); // Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off! @@ -542,11 +543,21 @@ float VoteCommand_checknasty(string vote_command) return true; } +// NOTE: requires input to be surrounded by spaces +string VoteCommand_checkreplacements(string input) +{ + string output = input; + // allow gotomap replacements + output = strreplace(" map ", " gotomap ", output); + output = strreplace(" chmap ", " gotomap ", output); + return output; +} + float VoteCommand_checkinlist(string vote_command, string list) { - string l = strcat(" ", list, " "); + string l = VoteCommand_checkreplacements(strcat(" ", list, " ")); - if (strstrofs(l, strcat(" ", vote_command, " "), 0) >= 0) return true; + if (strstrofs(l, VoteCommand_checkreplacements(strcat(" ", vote_command, " ")), 0) >= 0) return true; return false; } @@ -825,7 +836,7 @@ void VoteCommand_call(int request, entity caller, int argc, string vote_command) { print_to(caller, "^1Only connected clients can vote."); } - else if (timeout_status) + else if (timeout_status && vote_command != "timein") { print_to(caller, "^1You can not call a vote while a timeout is active."); }