From: Mircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Mon, 24 Oct 2011 13:21:19 +0000 (+0300)
Subject: Print information about spawned objects to the server by default. Also add informatio... 
X-Git-Tag: xonotic-v0.6.0~35^2~18^2~217
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8e87e6bf749066d4295c974ad34334ddc6b826dc;p=xonotic%2Fxonotic-data.pk3dir.git

Print information about spawned objects to the server by default. Also add information about the spawn command in help.
---

diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg
index 68ca0eab9..079a409a3 100644
--- a/defaultXonotic.cfg
+++ b/defaultXonotic.cfg
@@ -542,6 +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_playerclip_collisions 1 "0 = disable collision testing against playerclips, might be useful on some defrag maps"
 set g_botclip_collisions 1 "0 = disable collision testing against botclips, might be useful on some defrag maps"
diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh
index 0187f44e6..46378fe57 100644
--- a/qcsrc/server/autocvars.qh
+++ b/qcsrc/server/autocvars.qh
@@ -1199,3 +1199,4 @@ float autocvar_sv_gameplayfix_gravityunaffectedbyticrate;
 float autocvar_g_trueaim_minrange;
 float autocvar_g_debug_defaultsounds;
 float autocvar_g_loituma;
+float autocvar_g_sandbox_info;
diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc
index 0e20901ac..0e8303e1e 100644
--- a/qcsrc/server/mutators/sandbox.qc
+++ b/qcsrc/server/mutators/sandbox.qc
@@ -13,6 +13,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
 		if(argv(1) == "help")
 		{
 			print_to(self, "You can use the following sandbox commands:");
+			print_to(self, "^7\"^2spawn ^3models/foo/bar.md3^7\" spawns a new object in front of the player, and gives it the specified model");
 			return 1;
 		}
 		else if(argv(1) == "spawn")
@@ -26,6 +27,9 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
 			setorigin(e, trace_endpos);
 			setmodel(e, "models/vehicles-static/raptor.md3");
 
+			if(autocvar_g_sandbox_info)
+				print(strcat(self.netname, " spawned an object at origin ", vtos(e.origin), "\n"));
+
 			return 1;
 		}
 	}