]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/warpzone/server.qc
Remove various SELFPARAM
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / warpzone / server.qc
index f8260b5ad0a7c3c2b7c4fb52bef6699efe7ade73..0fb8dd235ff99033e04148fa9662ff9764ee43cc 100644 (file)
@@ -173,7 +173,7 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
                ts.SendEntity3 = WarpZone_Teleported_Send;
                ts.SendFlags = 0xFFFFFF;
                ts.drawonlytoclient = player;
-               ts.think = SUB_Remove_self;
+               setthink(ts, SUB_Remove);
                ts.nextthink = time + 1;
                ts.owner = player;
                ts.enemy = wz;
@@ -190,8 +190,8 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1)
        return 1;
 }
 
-void WarpZone_Touch ()
-{SELFPARAM();
+void WarpZone_Touch (entity this)
+{
        if(other.classname == "trigger_warpzone")
                return;
 
@@ -206,7 +206,7 @@ void WarpZone_Touch ()
 #endif
                return;
 
-       if(WarpZoneLib_ExactTrigger_Touch())
+       if(WarpZoneLib_ExactTrigger_Touch(self, other))
                return;
 
 #ifdef SVQC
@@ -363,7 +363,7 @@ bool WarpZone_Camera_Send(entity this, entity to, int sendflags)
 
 #ifdef WARPZONELIB_KEEPDEBUG
 float WarpZone_CheckProjectileImpact(entity player)
-{SELFPARAM();
+{
        vector o0, v0;
 
        .vector orgvec, velvec;
@@ -435,8 +435,8 @@ float WarpZone_CheckProjectileImpact(entity player)
 #endif
 #endif
 
-float WarpZone_Projectile_Touch()
-{SELFPARAM();
+float WarpZone_Projectile_Touch(entity this)
+{
        if(other.classname == "trigger_warpzone")
                return true;
 
@@ -479,9 +479,8 @@ float WarpZone_Projectile_Touch()
                save_ent = trace_ent;
                save_inopen = trace_inopen;
                save_inwater = trace_inwater;
-               float f;
-               if((f = WarpZone_CheckProjectileImpact(this)) != 0)
-                       return (f > 0);
+               float f = WarpZone_CheckProjectileImpact(this);
+               if (f) return (f > 0);
                trace_dpstartcontents = save_dpstartcontents;
                trace_dphitcontents = save_dphitcontents;
                trace_dphitq3surfaceflags = save_dphitq3surfaceflags;
@@ -543,8 +542,8 @@ void WarpZonePosition_InitStep_FindTarget(entity this)
        this.enemy.aiment = this;
 }
 
-void WarpZoneCamera_Think()
-{SELFPARAM();
+void WarpZoneCamera_Think(entity this)
+{
        if(this.warpzone_save_origin != this.origin
        || this.warpzone_save_angles != this.angles
        || this.warpzone_save_eorigin != this.enemy.origin
@@ -582,7 +581,7 @@ void WarpZoneCamera_InitStep_FindTarget(entity this)
        this.SendFlags = 0xFFFFFF;
        if(this.spawnflags & 1)
        {
-               this.think = WarpZoneCamera_Think;
+               setthink(this, WarpZoneCamera_Think);
                this.nextthink = time;
        }
        else
@@ -708,7 +707,7 @@ void WarpZone_InitStep_FindTarget(entity this)
        }
 }
 
-void WarpZone_Think();
+void WarpZone_Think(entity this);
 void WarpZone_InitStep_FinalizeTransform(entity this)
 {
        if(!this.enemy || this.enemy.enemy != this)
@@ -719,11 +718,11 @@ void WarpZone_InitStep_FinalizeTransform(entity this)
 
        warpzone_warpzones_exist = 1;
        WarpZone_SetUp(this, this.warpzone_origin, this.warpzone_angles, this.enemy.warpzone_origin, this.enemy.warpzone_angles);
-       this.touch = WarpZone_Touch;
+       settouch(this, WarpZone_Touch);
        this.SendFlags = 0xFFFFFF;
        if(this.spawnflags & 1)
        {
-               this.think = WarpZone_Think;
+               setthink(this, WarpZone_Think);
                this.nextthink = time;
        }
        else
@@ -761,7 +760,7 @@ spawnfunc(trigger_warpzone)
                this.scale = 1;
        string m;
        m = this.model;
-       WarpZoneLib_ExactTrigger_Init();
+       WarpZoneLib_ExactTrigger_Init(this);
        if(m != "")
        {
                precache_model(m);
@@ -817,8 +816,8 @@ void WarpZones_Reconnect()
                WarpZone_InitStep_FinalizeTransform(e);
 }
 
-void WarpZone_Think()
-{SELFPARAM();
+void WarpZone_Think(entity this)
+{
        if(this.warpzone_save_origin != this.origin
        || this.warpzone_save_angles != this.angles
        || this.warpzone_save_eorigin != this.enemy.origin
@@ -838,7 +837,6 @@ void WarpZone_Think()
 
 void WarpZone_StartFrame()
 {
-       SELFPARAM();
        if (!warpzone_initialized)
        {
                warpzone_initialized = true;
@@ -866,24 +864,23 @@ void WarpZone_StartFrame()
 
                        // warpzones
                        if (warpzone_warpzones_exist) {
-                               setself(WarpZone_Find(it.origin + it.mins, it.origin + it.maxs));
-                               if (self)
-                               if (!WarpZoneLib_ExactTrigger_Touch())
-                               if (WarpZone_PlaneDist(self, it.origin + it.view_ofs) <= 0)
-                                       WarpZone_Teleport(self, it, -1, 0); // NOT triggering targets by this!
+                               entity e = WarpZone_Find(it.origin + it.mins, it.origin + it.maxs);
+                               if (e)
+                               if (!WarpZoneLib_ExactTrigger_Touch(e, other))
+                               if (WarpZone_PlaneDist(e, it.origin + it.view_ofs) <= 0)
+                                       WarpZone_Teleport(e, it, -1, 0); // NOT triggering targets by this!
                        }
 
                        // teleporters
                        if(other.teleportable)
                        {
-                               setself(Teleport_Find(it.origin + it.mins, it.origin + it.maxs));
-                               if (self)
-                               if (!WarpZoneLib_ExactTrigger_Touch())
-                                       Simple_TeleportPlayer(self, other); // NOT triggering targets by this!
+                               entity ent = Teleport_Find(it.origin + it.mins, it.origin + it.maxs);
+                               if (ent)
+                               if (!WarpZoneLib_ExactTrigger_Touch(ent, other))
+                                       Simple_TeleportPlayer(ent, other); // NOT triggering targets by this!
                        }
                }
        });
-       setself(this);
        other = oldother;
 }