]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/sandbox/sandbox.qc
Introduce touch accessors
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / sandbox / sandbox.qc
index 6b97a28f1da092aee3465c5c1f7084492b08fe3e..5ab3ca02b49602846eb976c40bb76e2ebf41d789 100644 (file)
@@ -108,7 +108,7 @@ entity sandbox_ObjectEdit_Get(float permissions)
        // Attached objects are SOLID_NOT and do not get traced.
 
        crosshair_trace_plusvisibletriggers(self);
-       if(vlen(self.origin - trace_ent.origin) > autocvar_g_sandbox_editor_distance_edit)
+       if(vdist(self.origin - trace_ent.origin, >, autocvar_g_sandbox_editor_distance_edit))
                return world; // out of trace range
        if(trace_ent.classname != "object")
                return world; // entity is not an object
@@ -187,7 +187,7 @@ entity sandbox_ObjectSpawn(float database)
        e.frame = 0;
        e.skin = 0;
        e.material = string_null;
-       e.touch = sandbox_ObjectFunction_Touch;
+       settouch(e, sandbox_ObjectFunction_Touch);
        e.think = sandbox_ObjectFunction_Think;
        e.nextthink = time;
        //e.effects |= EF_SELECTABLE; // don't do this all the time, maybe just when editing objects?
@@ -213,7 +213,7 @@ entity sandbox_ObjectSpawn(float database)
                e.angles_y = self.v_angle.y;
        }
 
-       WITH(entity, self, e, CSQCMODEL_AUTOINIT(e));
+       CSQCMODEL_AUTOINIT(e);
 
        object_count += 1;
        return e;