]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Instead of causing an error, print a message about the missiong vote restriction...
authorMario <mario@smbclan.net>
Thu, 14 Apr 2016 06:54:10 +0000 (16:54 +1000)
committerMario <mario@smbclan.net>
Thu, 14 Apr 2016 06:54:10 +0000 (16:54 +1000)
qcsrc/server/command/vote.qc

index 4bd8dee6e5d15d30c953db2971caf57f1b8868b2..2b1e4e75deef9d1f91b540e5ff91403dd5d0078d 100644 (file)
@@ -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