Cvar the spawning distance of objects. Also give spawned objects an appropriate class...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 13:32:38 +0000 (16:32 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 13:32:38 +0000 (16:32 +0300)
defaultXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/mutators/sandbox.qc

index 079a409a3ff81eef6918844d822f6e4ee275fea3..aa5030e13fe209477f81b2310aa2942e0c9f0b41 100644 (file)
@@ -543,6 +543,7 @@ 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_editor_distance 150 "distance by which objects spawn in front of the player"
 
 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"
index 46378fe57a9515ea6b59720b044772053d2ad35e..be32c8ab860d7a6aee410a7a89cbdbd19e6401fb 100644 (file)
@@ -1200,3 +1200,4 @@ float autocvar_g_trueaim_minrange;
 float autocvar_g_debug_defaultsounds;
 float autocvar_g_loituma;
 float autocvar_g_sandbox_info;
+float autocvar_g_sandbox_editor_distance;
index d07b400bfc2020d605bd36e9066c393c5a53ca39..80529ed9594e42290dde7c26d51d1860c75f624b 100644 (file)
@@ -22,8 +22,9 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
 
                        entity e;
                        e = spawn();
+                       e.classname = "object";
                        makevectors(self.v_angle);
-                       traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 250, MOVE_NOMONSTERS, self);
+                       traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * autocvar_g_sandbox_editor_distance, MOVE_NOMONSTERS, self);
                        setorigin(e, trace_endpos);
                        setmodel(e, "models/vehicles-static/raptor.md3");
                        e.angles = self.v_angle; // give the player's angles to the object, as he spawns it from behind