]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/sv_cmd.qc
Merge branch 'master' into Mario/monsters
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / sv_cmd.qc
index 941b2a23e4785d30d3c3510479b379ea5bc16f57..b7256deed443aafafa2dc3c76b53a3bf79ff2245 100644 (file)
@@ -146,6 +146,7 @@ void GameCommand_butcher(float request)
                case CMD_REQUEST_COMMAND:
                {
                        if(g_td) { print("This command doesn't work in Tower Defense.\n"); return; }
+                       if(autocvar_g_campaign) { print("This command doesn't work in campaign mode.\n"); return; }
                
             float removed_count = 0;
                        entity montokill, head;
@@ -153,6 +154,12 @@ void GameCommand_butcher(float request)
             FOR_EACH_MONSTER(montokill)
             {
                                WaypointSprite_Kill(montokill.sprite);
+                               
+                               if(montokill.weaponentity)
+                                       remove(montokill.weaponentity);
+                                       
+                               if(montokill.iceblock)
+                                       remove(montokill.iceblock);
                     
                 remove(montokill);
                 removed_count += 1;
@@ -161,6 +168,9 @@ void GameCommand_butcher(float request)
                        FOR_EACH_PLAYER(head)
                                head.monstercount = 0;
                                
+                       monsters_total = 0; // reset stats?
+                       monsters_killed = 0;
+                               
                        totalspawned = 0;
                        
                        if(removed_count <= 0)
@@ -1038,7 +1048,7 @@ void GameCommand_moveplayer(float request, float argc)
                                        // Where are we putting this player?
                                        if(destination == "spec" || destination == "spectator") 
                                        {
-                                               if(client.classname != "spectator" && client.classname != "observer")
+                                               if(!IS_SPEC(client) && !IS_OBSERVER(client))
                                                {
                                                        self = client;
                                                        PutObserverInServer();
@@ -1053,7 +1063,7 @@ void GameCommand_moveplayer(float request, float argc)
                                        }
                                        else
                                        {
-                                               if(client.classname != "spectator" && client.classname != "observer")
+                                               if(!IS_SPEC(client) && !IS_OBSERVER(client))
                                                {
                                                        if(teamplay)
                                                        {
@@ -1147,7 +1157,7 @@ void GameCommand_nospectators(float request)
                        entity plr;
                        FOR_EACH_CLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
                        {
-                               if(plr.classname == "spectator" || plr.classname == "observer")
+                               if(IS_SPEC(plr) || IS_OBSERVER(plr))
                                {
                                        plr.spectatortime = time;
                                        Send_Notification(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
@@ -1630,10 +1640,10 @@ void GameCommand_trace(float request, float argc)
                                
                                case "walk":
                                {
-                                       if(argc == 3)
+                                       if(argc == 4)
                                        {
                                                e = nextent(world);
-                                               if(tracewalk(e, stov(argv(1)), e.mins, e.maxs, stov(argv(2)), MOVE_NORMAL))
+                                               if(tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL))
                                                        print("can walk\n");
                                                else
                                                        print("cannot walk\n");
@@ -1643,10 +1653,10 @@ void GameCommand_trace(float request, float argc)
                                
                                case "showline":
                                {
-                                       if(argc == 3)
+                                       if(argc == 4)
                                        {
-                                               vv = stov(argv(1));
-                                               dv = stov(argv(2));
+                                               vv = stov(argv(2));
+                                               dv = stov(argv(3));
                                                traceline(vv, dv, MOVE_NORMAL, world);
                                                trailparticles(world, particleeffectnum("TR_NEXUIZPLASMA"), vv, trace_endpos);
                                                trailparticles(world, particleeffectnum("TR_CRYLINKPLASMA"), trace_endpos, dv);
@@ -1763,7 +1773,6 @@ void GameCommand_(float request)
 // ==================================
 
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-// Common commands have double indentation to separate them a bit.
 #define SERVER_COMMANDS(request,arguments,command) \
        SERVER_COMMAND("adminmsg", GameCommand_adminmsg(request, arguments), "Send an admin message to a client directly") \
        SERVER_COMMAND("butcher", GameCommand_butcher(request), "Instantly removes all monsters on the map") \