]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/common.qc
Apply a standard alphabetical sort order to the server side includes and use constant...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / common.qc
index 643afa3f177887ff8ab2754a30c882eb90263231..4e001af734975c785c40bbf3282074dac678b9ca 100644 (file)
@@ -1,16 +1,17 @@
 #include "common.qh"
 
-#include <server/defs.qh>
-#include <server/miscfunctions.qh>
-
 #include <common/command/_mod.qh>
-#include "common.qh"
-
-#include "../scores.qh"
-
 #include <common/monsters/_mod.qh>
 #include <common/notifications/all.qh>
+#include <common/stats.qh>
+#include <common/weapons/_all.qh>
 #include <lib/warpzone/common.qh>
+#include <server/chat.qh>
+#include <server/client.qh>
+#include <server/command/common.qh>
+#include <server/mutators/_mod.qh>
+#include <server/scores.qh>
+#include <server/world.qh>
 
 
 // ====================================================
@@ -28,7 +29,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 +396,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;
                                }
@@ -405,7 +406,7 @@ void CommonCommand_editmob(int request, entity caller, int argc)
                                        if (mon.realowner != caller && autocvar_g_monsters_edit < 2) { print_to(caller, "This monster does not belong to you"); return; }
                                        if (!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; }
 
-                                       Damage(mon, NULL, NULL, GetResourceAmount(mon, RESOURCE_HEALTH) + mon.max_health + 200, DEATH_KILL.m_id, DMG_NOWEP, mon.origin, '0 0 0');
+                                       Damage(mon, NULL, NULL, GetResource(mon, RES_HEALTH) + mon.max_health + 200, DEATH_KILL.m_id, DMG_NOWEP, mon.origin, '0 0 0');
                                        print_to(caller, strcat("Your pet '", mon.monster_name, "' has been brutally mutilated"));
                                        return;
                                }
@@ -416,7 +417,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 +438,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;
 
@@ -475,7 +476,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");
@@ -717,7 +718,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.");
                                }