]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
g_sandbox_info - Print information about spawned / removed objects when 1, and also...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 21:58:25 +0000 (00:58 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 27 Oct 2011 21:58:25 +0000 (00:58 +0300)
defaultXonotic.cfg
qcsrc/server/mutators/sandbox.qc

index 5969527c0e63b5d993a51ea77ae596aa06a81e08..b1d22d1918e9acc45fd0007d2c01e4829adc5b14 100644 (file)
@@ -542,7 +542,7 @@ set g_player_brightness 0   "set to 2 for brighter players"
 seta g_balance_cloaked_alpha 0.25
 
 set g_sandbox 0 "allow players to spawn and edit objects around the map"
-set g_sandbox_info 1 "print non-critical information to the server"
+set g_sandbox_info 1 "print object information to the server. 1 prints info about spawned / removed objects, 2 also prints info about edited objects"
 set g_sandbox_editor_maxobjects 1000 "maximum number of objects that may exist at a time"
 set g_sandbox_editor_free 0 "when enabled, players can edit any object on the map, not just the objects they've spawned"
 set g_sandbox_editor_distance_spawn 200 "distance at which objects spawn in front of the player"
index 4b62a18d9c52234c68183c4535627582a6dc3479..2535c7f240d2b69f8afd4226e512d28c803a9230 100644 (file)
@@ -246,8 +246,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                        if(e.netname == argv(2))
                                        {
                                                W_ThrowNewWeapon(self, i, FALSE, trace_endpos, '0 0 0');
-                                               if(autocvar_g_sandbox_info)
-                                                       print("^3SANDBOX - SERVER: ^7", strcat(self.netname, " spawned a ^2", e.netname, "^7 at origin ", vtos(e.origin), "\n"));
+                                               if(autocvar_g_sandbox_info > 0)
+                                                       print("^3SANDBOX - SERVER: ^7", strcat(self.netname, " spawned a ^2", e.netname, "^7 at origin ^3", vtos(e.origin), "\n"));
                                                return TRUE;
                                        }
                                }
@@ -276,8 +276,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                e = sandbox_SpawnObject();
                                setmodel(e, argv(2));
 
-                               if(autocvar_g_sandbox_info)
-                                       print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " spawned an object at origin ", vtos(e.origin), "\n"));
+                               if(autocvar_g_sandbox_info > 0)
+                                       print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " spawned an object at origin ^3", vtos(e.origin), "\n"));
 
                                return TRUE;
 
@@ -286,8 +286,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                e = sandbox_EditObject_Get();
                                if(e != world)
                                {
-                                       if(autocvar_g_sandbox_info)
-                                               print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " removed an object at origin ", vtos(e.origin), "\n"));
+                                       if(autocvar_g_sandbox_info > 0)
+                                               print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " removed an object at origin ^3", vtos(e.origin), "\n"));
                                        sandbox_RemoveObject(e);
                                        return TRUE;
                                }
@@ -331,8 +331,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                                sandbox_Storage_Load(e, self.object_clipboard);
 
                                                print_to(self, "^2SANDBOX - INFO: ^7Object pasted successfully");
-                                               if(autocvar_g_sandbox_info)
-                                                       print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " pasted an object at origin ", vtos(e.origin), "\n"));
+                                               if(autocvar_g_sandbox_info > 0)
+                                                       print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " pasted an object at origin ^3", vtos(e.origin), "\n"));
                                                return TRUE;
                                }
                                return TRUE;
@@ -475,6 +475,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                                                        print_to(self, "^1SANDBOX - WARNING: ^7Invalid object property. For usage information, type 'sandbox help'");
                                                        break;
                                        }
+                                       if(autocvar_g_sandbox_info > 1)
+                                               print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n"));
                                        return TRUE;
                                }
 
@@ -510,11 +512,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerPreThink)
                grab = TRUE;
 
        if(Drag(e, grab)) // execute dragging
-       {
-               if(autocvar_g_sandbox_info)
-                       print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " grabbed an object at origin ", vtos(e.origin), "\n"));
                return TRUE;
-       }
 
        return FALSE;
 }