From 2046b24b4146a7e4a1d63307ede7f8f3fbe0032c Mon Sep 17 00:00:00 2001 From: Martin Taibr Date: Sat, 23 Sep 2017 06:30:12 +0200 Subject: [PATCH] sed IFTARGETED --- qcsrc/common/triggers/func/conveyor.qc | 2 +- qcsrc/common/triggers/func/door.qc | 4 ++-- qcsrc/common/triggers/func/door_secret.qc | 2 +- qcsrc/common/triggers/func/pointparticles.qc | 2 +- qcsrc/common/triggers/misc/laser.qc | 2 +- qcsrc/common/triggers/misc/teleport_dest.qc | 2 +- qcsrc/common/triggers/platforms.qc | 2 +- qcsrc/common/triggers/target/speaker.qc | 4 ++-- qcsrc/common/triggers/trigger/gravity.qc | 2 +- qcsrc/common/triggers/trigger/multivibrator.qc | 2 +- qcsrc/common/triggers/triggers.qh | 4 +++- 11 files changed, 15 insertions(+), 13 deletions(-) diff --git a/qcsrc/common/triggers/func/conveyor.qc b/qcsrc/common/triggers/func/conveyor.qc index 6adbcc65f..960ee2150 100644 --- a/qcsrc/common/triggers/func/conveyor.qc +++ b/qcsrc/common/triggers/func/conveyor.qc @@ -119,7 +119,7 @@ void conveyor_init(entity this) this.movedir *= this.speed; setthink(this, conveyor_think); this.nextthink = time; - IFTARGETED + if(THIS_TARGETED) { this.use = conveyor_use; this.reset = conveyor_reset; diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index dc0be6ae2..1add9f593 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -506,7 +506,7 @@ void LinkDoors(entity this) if (this.health) return; - IFTARGETED + if(THIS_TARGETED) return; if (this.items) return; @@ -574,7 +574,7 @@ void LinkDoors(entity this) if (this.health) return; - IFTARGETED + if(THIS_TARGETED) return; if (this.items) return; diff --git a/qcsrc/common/triggers/func/door_secret.qc b/qcsrc/common/triggers/func/door_secret.qc index 0bad196ab..671f7048a 100644 --- a/qcsrc/common/triggers/func/door_secret.qc +++ b/qcsrc/common/triggers/func/door_secret.qc @@ -220,7 +220,7 @@ spawnfunc(func_door_secret) setblocked(this, secret_blocked); this.speed = 50; this.use = fd_secret_use; - IFTARGETED + if(THIS_TARGETED) { } else diff --git a/qcsrc/common/triggers/func/pointparticles.qc b/qcsrc/common/triggers/func/pointparticles.qc index a0773f249..3676550d6 100644 --- a/qcsrc/common/triggers/func/pointparticles.qc +++ b/qcsrc/common/triggers/func/pointparticles.qc @@ -136,7 +136,7 @@ spawnfunc(func_pointparticles) Net_LinkEntity(this, (this.spawnflags & 4), 0, pointparticles_SendEntity); - IFTARGETED + if(THIS_TARGETED) { this.use = pointparticles_use; this.reset = pointparticles_reset; diff --git a/qcsrc/common/triggers/misc/laser.qc b/qcsrc/common/triggers/misc/laser.qc index 2059a8126..e4fd43c1a 100644 --- a/qcsrc/common/triggers/misc/laser.qc +++ b/qcsrc/common/triggers/misc/laser.qc @@ -241,7 +241,7 @@ spawnfunc(misc_laser) Net_LinkEntity(this, false, 0, laser_SendEntity); - IFTARGETED + if(THIS_TARGETED) { this.reset = laser_reset; this.reset(this); diff --git a/qcsrc/common/triggers/misc/teleport_dest.qc b/qcsrc/common/triggers/misc/teleport_dest.qc index fc3cec863..6e23a88ba 100644 --- a/qcsrc/common/triggers/misc/teleport_dest.qc +++ b/qcsrc/common/triggers/misc/teleport_dest.qc @@ -41,7 +41,7 @@ spawnfunc(info_teleport_destination) //setorigin(this, this.origin + '0 0 27'); // To fix a mappers' habit as old as Quake setorigin(this, this.origin); - IFTARGETED + if(THIS_TARGETED) { } else diff --git a/qcsrc/common/triggers/platforms.qc b/qcsrc/common/triggers/platforms.qc index 09e733000..703f1d05c 100644 --- a/qcsrc/common/triggers/platforms.qc +++ b/qcsrc/common/triggers/platforms.qc @@ -177,7 +177,7 @@ void plat_use(entity this, entity actor, entity trigger) void plat_reset(entity this) { - IFTARGETED + if(THIS_TARGETED) { setorigin(this, this.pos1); this.state = 4; diff --git a/qcsrc/common/triggers/target/speaker.qc b/qcsrc/common/triggers/target/speaker.qc index af327b443..355ba16c9 100644 --- a/qcsrc/common/triggers/target/speaker.qc +++ b/qcsrc/common/triggers/target/speaker.qc @@ -85,7 +85,7 @@ spawnfunc(target_speaker) if(!this.atten && !(this.spawnflags & 4)) { - IFTARGETED + if(THIS_TARGETED) this.atten = ATTEN_NORM; else this.atten = ATTEN_STATIC; @@ -96,7 +96,7 @@ spawnfunc(target_speaker) if(!this.volume) this.volume = 1; - IFTARGETED + if(THIS_TARGETED) { if(this.spawnflags & 8) // ACTIVATOR this.use = target_speaker_use_activator; diff --git a/qcsrc/common/triggers/trigger/gravity.qc b/qcsrc/common/triggers/trigger/gravity.qc index 3ea1562f0..4112dbdb1 100644 --- a/qcsrc/common/triggers/trigger/gravity.qc +++ b/qcsrc/common/triggers/trigger/gravity.qc @@ -97,7 +97,7 @@ spawnfunc(trigger_gravity) precache_sound(this.noise); this.state = true; - IFTARGETED + if(THIS_TARGETED) { this.use = trigger_gravity_use; if(this.spawnflags & 2) diff --git a/qcsrc/common/triggers/trigger/multivibrator.qc b/qcsrc/common/triggers/trigger/multivibrator.qc index d946efe5f..6bf0557f2 100644 --- a/qcsrc/common/triggers/trigger/multivibrator.qc +++ b/qcsrc/common/triggers/trigger/multivibrator.qc @@ -72,7 +72,7 @@ spawnfunc(trigger_multivibrator) setthink(this, multivibrator_send_think); this.nextthink = max(1, time); - IFTARGETED + if(THIS_TARGETED) multivibrator_reset(this); } #endif diff --git a/qcsrc/common/triggers/triggers.qh b/qcsrc/common/triggers/triggers.qh index 2b8274f4b..56ebb0c38 100644 --- a/qcsrc/common/triggers/triggers.qh +++ b/qcsrc/common/triggers/triggers.qh @@ -14,8 +14,10 @@ const float SPAWNFLAG_NOTOUCH = 1; .float height; +// we love double negation around here +// TODO check why grep doesn't find any assignments to it .float nottargeted; -#define IFTARGETED if(!this.nottargeted && this.targetname != "") +#define THIS_TARGETED !this.nottargeted && this.targetname != "" .float lip; -- 2.39.2