]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/gravity.qc
Cleanse the touch functions of the other evil
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / gravity.qc
index 9dcc710f0356b2102c0f20248c9a3e2e6739184b..cef8cb8bbe5f94838504e47b154e8f7e052549c7 100644 (file)
@@ -37,50 +37,50 @@ void trigger_gravity_use(entity this, entity actor, entity trigger)
        this.state = !this.state;
 }
 
-void trigger_gravity_touch(entity this)
+void trigger_gravity_touch(entity this, entity toucher)
 {
        float g;
 
        if(this.state != true)
                return;
 
-       EXACTTRIGGER_TOUCH;
+       EXACTTRIGGER_TOUCH(this, toucher);
 
        g = this.gravity;
 
        if (!(this.spawnflags & 1))
        {
-               if(other.trigger_gravity_check)
+               if(toucher.trigger_gravity_check)
                {
-                       if(this == other.trigger_gravity_check.enemy)
+                       if(this == toucher.trigger_gravity_check.enemy)
                        {
                                // same?
-                               other.trigger_gravity_check.count = 2; // gravity one more frame...
+                               toucher.trigger_gravity_check.count = 2; // gravity one more frame...
                                return;
                        }
 
                        // compare prio
-                       if(this.cnt > other.trigger_gravity_check.enemy.cnt)
-                               trigger_gravity_remove(other);
+                       if(this.cnt > toucher.trigger_gravity_check.enemy.cnt)
+                               trigger_gravity_remove(toucher);
                        else
                                return;
                }
-               other.trigger_gravity_check = spawn();
-               other.trigger_gravity_check.enemy = this;
-               other.trigger_gravity_check.owner = other;
-               other.trigger_gravity_check.gravity = other.gravity;
-               setthink(other.trigger_gravity_check, trigger_gravity_check_think);
-               other.trigger_gravity_check.nextthink = time;
-               other.trigger_gravity_check.count = 2;
-               if(other.gravity)
-                       g *= other.gravity;
+               toucher.trigger_gravity_check = spawn();
+               toucher.trigger_gravity_check.enemy = this;
+               toucher.trigger_gravity_check.owner = toucher;
+               toucher.trigger_gravity_check.gravity = toucher.gravity;
+               setthink(toucher.trigger_gravity_check, trigger_gravity_check_think);
+               toucher.trigger_gravity_check.nextthink = time;
+               toucher.trigger_gravity_check.count = 2;
+               if(toucher.gravity)
+                       g *= toucher.gravity;
        }
 
-       if (other.gravity != g)
+       if (toucher.gravity != g)
        {
-               other.gravity = g;
+               toucher.gravity = g;
                if(this.noise != "")
-                       _sound (other, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
+                       _sound (toucher, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
                UpdateCSQCProjectile(this.owner);
        }
 }