X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fvote.qc;h=e3347980d40a530169766f39150a720c44984a84;hb=2f553b6be14a316d31fe5c35df47c300ce6a1561;hp=b611ab2665896975ab0b4ce15c24da2480f61190;hpb=aa95e823f3a1cd929102eeaeedfe52978d4e118e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index b611ab266..e3347980d 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -1,29 +1,28 @@ #include "vote.qh" -#include -#include - #include -#include "vote.qh" - -#include "common.qh" - -#include "../g_damage.qh" -#include "../g_world.qh" -#include "../teamplay.qh" -#include "../race.qh" -#include "../round_handler.qh" -#include "../scores.qh" - -#include -#include - #include -#include +#include #include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ============================================= // Server side voting code, reworked by Samual @@ -116,7 +115,7 @@ void Nagger_ReadyCounted() // If the vote_caller is still here, return their name, otherwise vote_caller_name string OriginalCallerName() { - if (IS_REAL_CLIENT(vote_caller)) return playername(vote_caller, false); + if (IS_REAL_CLIENT(vote_caller)) return playername(vote_caller.netname, vote_caller.team, false); return vote_caller_name; } @@ -476,8 +475,8 @@ void ReadyRestart_force() void ReadyRestart() { - if (MUTATOR_CALLHOOK(ReadyRestart_Deny) || game_stopped || race_completing) localcmd("restart\n"); - else localcmd("\nsv_hook_gamerestart\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! // Otherwise scores could be manipulated during the countdown. @@ -542,11 +541,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 +834,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."); }