]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/sandbox.qc
Replace all direct assignments to self with setself(e)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / sandbox.qc
index a5d925d103e4d5224a34df74ef1e89b345883caf..430271d80df059113ca1cb8e3ba81e126201830c 100644 (file)
@@ -143,8 +143,7 @@ entity sandbox_ObjectSpawn(float database)
 {SELFPARAM();
        // spawn a new object with default properties
 
-       entity e, oldself;
-       e = spawn();
+       entity e = spawn();
        e.classname = "object";
        e.takedamage = DAMAGE_AIM;
        e.damageforcescale = 1;
@@ -179,10 +178,8 @@ entity sandbox_ObjectSpawn(float database)
                e.angles_y = self.v_angle.y;
        }
 
-       oldself = self;
-       self = e;
-       CSQCMODEL_AUTOINIT(self);
-       self = oldself;
+       SELFCALL(e, CSQCMODEL_AUTOINIT(e));
+       SELFCALL_DONE();
 
        object_count += 1;
        return e;