X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcommon.qc;h=8040742c8046118e8890cca4e0ddb1a2914fd3a2;hb=bb4d4ccf443c2aa9a1db059874b669810f70593f;hp=fd0375cb35fb02363cbb0698825a494c31aaed36;hpb=25f7a4a5f137ffb344c47107636fcfc7cdfa2045;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index fd0375cb3..8040742c8 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -1,16 +1,20 @@ #include "common.qh" -#include -#include - #include -#include "common.qh" - -#include "../scores.qh" - +#include #include #include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include // ==================================================== @@ -28,7 +32,7 @@ string GetCommandPrefix(entity caller) // if client return player nickname, or if server return admin nickname string GetCallerName(entity caller) { - if (caller) return playername(caller, false); + if (caller) return playername(caller.netname, caller.team, false); else return ((autocvar_sv_adminnick != "") ? autocvar_sv_adminnick : "SERVER ADMIN"); // autocvar_hostname } @@ -395,7 +399,7 @@ void CommonCommand_editmob(int request, entity caller, int argc) totalspawned += 1; WarpZone_TraceBox(CENTER_OR_VIEWOFS(caller), caller.mins, caller.maxs, CENTER_OR_VIEWOFS(caller) + v_forward * 150, true, caller); - mon = spawnmonster(spawn(), arg_lower, 0, caller, caller, trace_endpos, false, false, moveflag); + mon = spawnmonster(spawn(), arg_lower, MON_Null, caller, caller, trace_endpos, false, false, moveflag); print_to(caller, strcat("Spawned ", mon.monster_name)); return; } @@ -416,7 +420,7 @@ void CommonCommand_editmob(int request, entity caller, int argc) if (!autocvar_g_monsters_edit) { print_to(caller, "Monster editing is disabled"); return; } if (!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; } if (mon.realowner != caller && autocvar_g_monsters_edit < 2) { print_to(caller, "This monster does not belong to you"); return; } - if (mon.monsterid == MON_MAGE.monsterid) { print_to(caller, "Mage skins can't be changed"); return; } // TODO + if (mon.monsterdef == MON_MAGE) { print_to(caller, "Mage skins can't be changed"); return; } // TODO mon.skin = stof(argument); print_to(caller, strcat("Monster skin successfully changed to ", ftos(mon.skin))); @@ -437,7 +441,7 @@ void CommonCommand_editmob(int request, entity caller, int argc) case "butcher": { if (caller) { print_to(caller, "This command is not available to players"); return; } - if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFOF("%s", M_ARGV(0, string)); return; } + if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(M_ARGV(0, string)); return; } int tmp_remcount = 0; @@ -459,9 +463,9 @@ void CommonCommand_editmob(int request, entity caller, int argc) default: case CMD_REQUEST_USAGE: { - print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " editmob command [arguments]")); - print_to(caller, " Where 'command' can be butcher spawn skin movetarget kill name"); - print_to(caller, " spawn, skin, movetarget and name require 'arguments'"); + print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " editmob []")); + print_to(caller, " Where can be butcher spawn skin movetarget kill name"); + print_to(caller, " spawn, skin, movetarget and name require "); print_to(caller, " spawn also takes arguments list and random"); print_to(caller, " Monster will follow owner if third argument of spawn command is not defined"); return; @@ -475,7 +479,7 @@ void CommonCommand_info(int request, entity caller, int argc) { case CMD_REQUEST_COMMAND: { - string command = builtin_cvar_string(strcat("sv_info_", argv(1))); + string command = cvar_string(strcat("sv_info_", argv(1))); if (command) wordwrap_sprint(caller, command, 1000); else print_to(caller, "ERROR: unsupported info command"); @@ -486,8 +490,8 @@ void CommonCommand_info(int request, entity caller, int argc) default: case CMD_REQUEST_USAGE: { - print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " info request")); - print_to(caller, " Where 'request' is the suffixed string appended onto the request for cvar."); + print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " info ")); + print_to(caller, " Where is the suffixed string appended onto the request for cvar."); return; } } @@ -717,7 +721,7 @@ void CommonCommand_timeout(int request, entity caller) // DEAR GOD THIS COMMAND { print_to(caller, "^7Error: You can not call a timeout while a vote is active."); } - else if (warmup_stage && !g_warmup_allow_timeout) + else if (warmup_stage && !autocvar_g_warmup_allow_timeout) { print_to(caller, "^7Error: You can not call a timeout in warmup-stage."); } @@ -749,7 +753,7 @@ void CommonCommand_timeout(int request, entity caller) // DEAR GOD THIS COMMAND timeout_time = autocvar_sv_timeout_length; timeout_leadtime = autocvar_sv_timeout_leadtime; - timeout_handler = spawn(); + timeout_handler = new(timeout_handler); setthink(timeout_handler, timeout_handler_think); timeout_handler.nextthink = time; // always let the entity think asap @@ -827,8 +831,8 @@ void CommonCommand_who(int request, entity caller, int argc) default: case CMD_REQUEST_USAGE: { - print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " who [separator]")); - print_to(caller, " Where 'separator' is the optional string to separate the values with, default is a space."); + print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " who []")); + print_to(caller, " Where is the optional string to separate the values with, default is a space."); return; } }