]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Purge other from blocked
authorMario <mario@smbclan.net>
Sun, 19 Jun 2016 17:40:18 +0000 (03:40 +1000)
committerMario <mario@smbclan.net>
Sun, 19 Jun 2016 17:40:18 +0000 (03:40 +1000)
qcsrc/common/physics/movetypes/movetypes.qh
qcsrc/common/triggers/func/button.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/door_secret.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/platforms.qh
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/lib/self.qh

index 764b993805ad55ec44a864e806e79dd98ad5529d..09b6e4d96d0cc17a6c36a7313b39002d285ff056 100644 (file)
@@ -8,7 +8,7 @@
 .float move_ltime;
 .void(entity this) move_think;
 .float move_nextthink;
-.void(entity this) move_blocked;
+.void(entity this, entity blocker) move_blocked;
 
 .float move_movetype;
 .float move_time;
index f419553b3f28a9f008e2d5280c467e6246bb159b..b186066e602b1523586a6d4f299a162445ee7efa 100644 (file)
@@ -28,7 +28,7 @@ void button_return(entity this)
 }
 
 
-void button_blocked(entity this)
+void button_blocked(entity this, entity blocker)
 {
        // do nothing, just don't come all the way back out
 }
index 25c1a27b3922491ccdb81c90e03828ee571b7b71..2b3decf64ff3dcda89bf58bfeaaf8412de15e37f 100644 (file)
@@ -23,33 +23,33 @@ THINK FUNCTIONS
 void door_go_down(entity this);
 void door_go_up(entity this);
 void door_rotating_go_down(entity this);
-void door_rotating_go_up(entity this);
+void door_rotating_go_up(entity this, entity oth);
 
-void door_blocked(entity this)
+void door_blocked(entity this, entity blocker)
 {
        if((this.spawnflags & 8)
 #ifdef SVQC
-               && (other.takedamage != DAMAGE_NO)
+               && (blocker.takedamage != DAMAGE_NO)
 #elif defined(CSQC)
-               && !IS_DEAD(other)
+               && !IS_DEAD(blocker)
 #endif
        )
        { // KIll Kill Kill!!
 #ifdef SVQC
-               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
 #endif
        }
        else
        {
 #ifdef SVQC
-               if((this.dmg) && (other.takedamage == DAMAGE_YES))    // Shall we bite?
-                       Damage (other, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               if((this.dmg) && (blocker.takedamage == DAMAGE_YES))    // Shall we bite?
+                       Damage (blocker, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
 #endif
 
                 // don't change direction for dead or dying stuff
-               if(IS_DEAD(other)
+               if(IS_DEAD(blocker)
 #ifdef SVQC
-                       && (other.takedamage == DAMAGE_NO)
+                       && (blocker.takedamage == DAMAGE_NO)
 #endif
                )
                {
@@ -61,7 +61,7 @@ void door_blocked(entity this)
                                door_go_up (this);
                        } else
                        {
-                               door_rotating_go_up (this);
+                               door_rotating_go_up(this, blocker);
                        }
                                else
                        if (this.classname == "door")
@@ -77,8 +77,8 @@ void door_blocked(entity this)
                else
                {
                        //gib dying stuff just to make sure
-                       if((this.dmg) && (other.takedamage != DAMAGE_NO))    // Shall we bite?
-                               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       if((this.dmg) && (blocker.takedamage != DAMAGE_NO))    // Shall we bite?
+                               Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
                }
 #endif
        }
@@ -235,15 +235,15 @@ void door_fire(entity this, entity actor, entity trigger)
                        door_go_up(e);
                } else {
                        // if the BIDIR spawnflag (==2) is set and the trigger has set trigger_reverse, reverse the opening direction
-                       if ((e.spawnflags & 2) && other.trigger_reverse!=0 && e.lip != 666 && e.state == STATE_BOTTOM) {
+                       if ((e.spawnflags & 2) && trigger.trigger_reverse!=0 && e.lip != 666 && e.state == STATE_BOTTOM) {
                                e.lip = 666; // e.lip is used to remember reverse opening direction for door_rotating
                                e.pos2 = '0 0 0' - e.pos2;
                        }
                        // if BIDIR_IN_DOWN (==8) is set, prevent the door from reoping during closing if it is triggered from the wrong side
                        if (!((e.spawnflags & 2) &&  (e.spawnflags & 8) && e.state == STATE_DOWN
-                               && (((e.lip == 666) && (other.trigger_reverse == 0)) || ((e.lip != 666) && (other.trigger_reverse != 0)))))
+                               && (((e.lip == 666) && (trigger.trigger_reverse == 0)) || ((e.lip != 666) && (trigger.trigger_reverse != 0)))))
                        {
-                               door_rotating_go_up(e);
+                               door_rotating_go_up(e, trigger);
                        }
                }
                e = e.enemy;
@@ -308,28 +308,28 @@ void door_touch(entity this, entity toucher)
 #endif
 }
 
-void door_generic_plat_blocked(entity this)
+void door_generic_plat_blocked(entity this, entity blocker)
 {
-       if((this.spawnflags & 8) && (other.takedamage != DAMAGE_NO)) { // Kill Kill Kill!!
+       if((this.spawnflags & 8) && (blocker.takedamage != DAMAGE_NO)) { // Kill Kill Kill!!
 #ifdef SVQC
-               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
 #endif
        }
        else
        {
 
 #ifdef SVQC
-               if((this.dmg) && (other.takedamage == DAMAGE_YES))    // Shall we bite?
-                       Damage (other, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               if((this.dmg) && (blocker.takedamage == DAMAGE_YES))    // Shall we bite?
+                       Damage (blocker, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
 #endif
 
                 //Dont chamge direction for dead or dying stuff
-               if(IS_DEAD(other) && (other.takedamage == DAMAGE_NO))
+               if(IS_DEAD(blocker) && (blocker.takedamage == DAMAGE_NO))
                {
                        if (this.wait >= 0)
                        {
                                if (this.state == STATE_DOWN)
-                                       door_rotating_go_up (this);
+                                       door_rotating_go_up (this, blocker);
                                else
                                        door_rotating_go_down (this);
                        }
@@ -338,8 +338,8 @@ void door_generic_plat_blocked(entity this)
                else
                {
                        //gib dying stuff just to make sure
-                       if((this.dmg) && (other.takedamage != DAMAGE_NO))    // Shall we bite?
-                               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       if((this.dmg) && (blocker.takedamage != DAMAGE_NO))    // Shall we bite?
+                               Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
                }
 #endif
        }
@@ -382,7 +382,7 @@ void door_rotating_go_down(entity this)
        SUB_CalcAngleMove (this, this.pos1, TSPEED_LINEAR, this.speed, door_rotating_hit_bottom);
 }
 
-void door_rotating_go_up(entity this)
+void door_rotating_go_up(entity this, entity oth)
 {
        if (this.state == STATE_UP)
                return;         // already going up
@@ -400,7 +400,7 @@ void door_rotating_go_up(entity this)
        string oldmessage;
        oldmessage = this.message;
        this.message = "";
-       SUB_UseTargets(this, NULL, other); // TODO: is other needed here?
+       SUB_UseTargets(this, NULL, oth); // TODO: is oth needed here?
        this.message = oldmessage;
 }
 
index 3ae918fac96f7d5c83cbab75753da4840aea5167..600949fe5c0528f598c0c7692108cae2578058f9 100644 (file)
@@ -135,7 +135,7 @@ void fd_secret_done(entity this)
 
 .float door_finished;
 
-void secret_blocked(entity this)
+void secret_blocked(entity this, entity blocker)
 {
        if (time < this.door_finished)
                return;
index 93a57941b638d847730a5f5ee3692ffd6b263356..c1f481f8af515a262c516ac2b56c3ea698d22148 100644 (file)
@@ -1,17 +1,17 @@
-void generic_plat_blocked(entity this)
+void generic_plat_blocked(entity this, entity blocker)
 {
 #ifdef SVQC
-       if(this.dmg && other.takedamage != DAMAGE_NO)
+       if(this.dmg && blocker.takedamage != DAMAGE_NO)
        {
                if(this.dmgtime2 < time)
                {
-                       Damage (other, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       Damage (blocker, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
                        this.dmgtime2 = time + this.dmgtime;
                }
 
                // Gib dead/dying stuff
-               if(IS_DEAD(other))
-                       Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               if(IS_DEAD(blocker))
+                       Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
        }
 #endif
 }
@@ -139,23 +139,23 @@ void plat_trigger_use(entity this, entity actor, entity trigger)
 }
 
 
-void plat_crush(entity this)
+void plat_crush(entity this, entity blocker)
 {
-       if((this.spawnflags & 4) && (other.takedamage != DAMAGE_NO))
+       if((this.spawnflags & 4) && (blocker.takedamage != DAMAGE_NO))
        { // KIll Kill Kill!!
 #ifdef SVQC
-               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+               Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
 #endif
        }
        else
        {
 #ifdef SVQC
-               if((this.dmg) && (other.takedamage != DAMAGE_NO))
+               if((this.dmg) && (blocker.takedamage != DAMAGE_NO))
                {   // Shall we bite?
-                       Damage (other, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       Damage (blocker, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
                        // Gib dead/dying stuff
-                       if(IS_DEAD(other))
-                               Damage (other, this, this, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
+                       if(IS_DEAD(blocker))
+                               Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
                }
 #endif
 
index c728be596ddd9842b8f5de5abfdd053870c35fdd..f0727be3ca1fe59cf57b8779d60e20178ffc533b 100644 (file)
@@ -8,7 +8,7 @@ void plat_outside_touch(entity this, entity toucher);
 void plat_trigger_use(entity this, entity actor, entity trigger);
 void plat_go_up(entity this);
 void plat_go_down(entity this);
-void plat_crush(entity this);
+void plat_crush(entity this, entity blocker);
 const float PLAT_LOW_TRIGGER = 1;
 
 .float dmg;
index 938b5e3988e18661e803a097c30ff88ed9da8a45..d1f2522abbcccecde8fe3263b8cd1857d06a2162 100644 (file)
@@ -135,7 +135,7 @@ void W_Crylink_LinkExplode(entity e, entity e2, entity directhitentity)
        RadiusDamage(e, e.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * a, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * a, WEP_CVAR_BOTH(crylink, isprimary, radius), 
                                NULL, NULL, WEP_CVAR_BOTH(crylink, isprimary, force) * a, e.projectiledeathtype, directhitentity);
 
-       W_Crylink_LinkExplode(e.queuenext, e2);
+       W_Crylink_LinkExplode(e.queuenext, e2, directhitentity);
 
        e.classname = "spike_oktoremove";
        remove(e);
index 1eb5767fd1f421c394725404146c6e6b72cba3ee..5d42bdccd74c2c76927b7c8cf07734037d69d8b3 100644 (file)
@@ -72,9 +72,11 @@ SELFWRAP(touch, void, (), (entity this, entity toucher), (this, other))
 #define gettouch(e) SELFWRAP_GET(touch, e)
 #endif
 
-SELFWRAP(blocked, void, (), (entity this), (this))
+#ifndef MENUQC
+SELFWRAP(blocked, void, (), (entity this, entity blocker), (this, other))
 #define setblocked(e, f) SELFWRAP_SET(blocked, e, f)
 #define blocked stopusingthis
+#endif
 
 SELFWRAP(predraw, void, (), (entity this), (this))
 #define setpredraw(e, f) SELFWRAP_SET(predraw, e, f)