From: Mario Date: Thu, 14 Apr 2016 06:54:10 +0000 (+1000) Subject: Instead of causing an error, print a message about the missiong vote restriction... X-Git-Tag: xonotic-v0.8.2~961 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d4bb72881c9fa394756bcf471b6101dea92573e6;p=xonotic%2Fxonotic-data.pk3dir.git Instead of causing an error, print a message about the missiong vote restriction cvar --- diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 4bd8dee6e..2b1e4e75d 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -570,10 +570,15 @@ float VoteCommand_checkargs(float startpos, float argc) { float p, q, check, minargs; string cvarname = strcat("sv_vote_command_restriction_", argv(startpos)); - string cmdrestriction = cvar_string(cvarname); // note: this warns on undefined cvar. We want that. + string cmdrestriction = ""; // No we don't. string charlist, arg; float checkmate; + if(cvar_type(cvarname) & CVAR_TYPEFLAG_EXISTS) + cmdrestriction = cvar_string(cvarname); + else + LOG_INFO("NOTE: ", cvarname, " does not exist, no restrictions will be applied.\n"); + if (cmdrestriction == "") return true; ++startpos; // skip command name