From 17b2adabf26ae062a323bb0d2016bf2eea6aea14 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 20 Jun 2016 03:40:18 +1000 Subject: [PATCH] Purge other from blocked --- qcsrc/common/physics/movetypes/movetypes.qh | 2 +- qcsrc/common/triggers/func/button.qc | 2 +- qcsrc/common/triggers/func/door.qc | 52 ++++++++++----------- qcsrc/common/triggers/func/door_secret.qc | 2 +- qcsrc/common/triggers/platforms.qc | 24 +++++----- qcsrc/common/triggers/platforms.qh | 2 +- qcsrc/common/weapons/weapon/crylink.qc | 2 +- qcsrc/lib/self.qh | 4 +- 8 files changed, 46 insertions(+), 44 deletions(-) diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index 764b99380..09b6e4d96 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -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; diff --git a/qcsrc/common/triggers/func/button.qc b/qcsrc/common/triggers/func/button.qc index f419553b3..b186066e6 100644 --- a/qcsrc/common/triggers/func/button.qc +++ b/qcsrc/common/triggers/func/button.qc @@ -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 } diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index 25c1a27b3..2b3decf64 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -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; } diff --git a/qcsrc/common/triggers/func/door_secret.qc b/qcsrc/common/triggers/func/door_secret.qc index 3ae918fac..600949fe5 100644 --- a/qcsrc/common/triggers/func/door_secret.qc +++ b/qcsrc/common/triggers/func/door_secret.qc @@ -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; diff --git a/qcsrc/common/triggers/platforms.qc b/qcsrc/common/triggers/platforms.qc index 93a57941b..c1f481f8a 100644 --- a/qcsrc/common/triggers/platforms.qc +++ b/qcsrc/common/triggers/platforms.qc @@ -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 diff --git a/qcsrc/common/triggers/platforms.qh b/qcsrc/common/triggers/platforms.qh index c728be596..f0727be3c 100644 --- a/qcsrc/common/triggers/platforms.qh +++ b/qcsrc/common/triggers/platforms.qh @@ -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; diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 938b5e398..d1f2522ab 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -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); diff --git a/qcsrc/lib/self.qh b/qcsrc/lib/self.qh index 1eb5767fd..5d42bdccd 100644 --- a/qcsrc/lib/self.qh +++ b/qcsrc/lib/self.qh @@ -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) -- 2.39.2