From: Samual Date: Thu, 29 Dec 2011 18:26:59 +0000 (-0500) Subject: Finish todo's for vote.qc X-Git-Tag: xonotic-v0.6.0~188^2~28^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=50058ee474eac817d5bca0f2135bc53b0f7a1eb1;p=xonotic%2Fxonotic-data.pk3dir.git Finish todo's for vote.qc --- diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 0a9412338..9548ab7ff 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -512,7 +512,6 @@ string ValidateMap(string validated_map, entity caller) float VoteCommand_parse(entity caller, string vote_command, string vote_list, float startpos, float argc) { string first_command; - entity victim; first_command = argv(startpos); @@ -539,11 +538,23 @@ float VoteCommand_parse(entity caller, string vote_command, string vote_list, fl case "kick": case "kickban": // catch all kick/kickban commands { - victim = GetIndexedEntity(argc, (startpos + 1)); - if not(victim) { return FALSE; } - // TODO: figure out how kick/kickban/ban commands work and re-write this to fit around them - vote_parsed_command = vote_command; - vote_parsed_display = strcat("^1", vote_command, " (^7", victim.netname, "^1): ", "todo"); + entity victim = GetIndexedEntity(argc, (startpos + 1)); + float accepted = VerifyClientEntity(victim, TRUE, FALSE); + + if(accepted > 0) + { + string reason = ((argc > next_token) ? substring(vote_command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token)) : "No reason provided."); + string command_arguments; + + if(first_command == "kickban") + command_arguments = strcat(ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ~"); + else + command_arguments = reason; + + vote_parsed_command = strcat(first_command, " # ", ftos(num_for_edict(victim)), " ", command_arguments); + vote_parsed_display = strcat("^1", vote_command, " (^7", victim.netname, "^1): ", reason); + } + else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return FALSE; } break; }