]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix the trace detection issue. Apparently, objects were not being traced because...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 20:07:42 +0000 (23:07 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 20:07:42 +0000 (23:07 +0300)
qcsrc/server/mutators/sandbox.qc

index a39223654a89c341f710ce41a731af00d3d1a640..747494d42ef6d8d540882ada7e3c26d60b99062f 100644 (file)
@@ -34,16 +34,17 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                        // spawn a new object
                        entity e;
                        e = spawn();
-                       e.owner = self;
+
+                       //e.owner = self; // for some reason, setting this causes collisions to break
                        e.classname = "object";
                        e.takedamage = DAMAGE_NO;
 
                        // those properties are defaults that can be edited later
                        e.movetype = MOVETYPE_TOSS;
-                       e.solid = SOLID_BBOX;
+                       e.solid = SOLID_BSP;
 
                        makevectors(self.v_angle);
-                       traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * autocvar_g_sandbox_editor_distance_spawn, MOVE_NOMONSTERS, self);
+                       traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * autocvar_g_sandbox_editor_distance_spawn, MOVE_NORMAL, self);
                        setorigin(e, trace_endpos);
                        setmodel(e, argv(2));
                        e.angles_y = self.v_angle_y; // apply the player's direction to the object, as he spawns it from behind
@@ -51,8 +52,6 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
                        if(autocvar_g_sandbox_info)
                                print(strcat(self.netname, " spawned an object at origin ", vtos(e.origin), "\n"));
 
-dprint(strcat(vtos(e.absmin), " - ", vtos(e.absmax), "\n"));
-
                        return TRUE;
                }
                else if(argv(1) == "spawn_item")
@@ -99,9 +98,6 @@ dprint(strcat(vtos(e.absmin), " - ", vtos(e.absmax), "\n"));
                                return TRUE;
                        }
 
-dprint(strcat(trace_ent.classname, "\n"));
-te_lightning2(world, self.origin + self.view_ofs + v_forward * 5 - v_up * 5, self.origin + self.view_ofs + v_forward * autocvar_g_sandbox_editor_distance_edit);
-
                        print_to(self, "WARNING: Object could not be removed. Make sure you are facing an object that you have spawned");
                        return TRUE;
                }