]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove an obscure macro from trigger code that was hiding a simple targetname check
authorMario <mario.mario@y7mail.com>
Sat, 30 May 2020 11:46:40 +0000 (21:46 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 30 May 2020 11:46:40 +0000 (21:46 +1000)
12 files changed:
qcsrc/common/mapobjects/func/conveyor.qc
qcsrc/common/mapobjects/func/door.qc
qcsrc/common/mapobjects/func/door_secret.qc
qcsrc/common/mapobjects/func/pointparticles.qc
qcsrc/common/mapobjects/misc/laser.qc
qcsrc/common/mapobjects/misc/teleport_dest.qc
qcsrc/common/mapobjects/platforms.qc
qcsrc/common/mapobjects/target/speaker.qc
qcsrc/common/mapobjects/trigger/gravity.qc
qcsrc/common/mapobjects/trigger/multivibrator.qc
qcsrc/common/mapobjects/triggers.qc
qcsrc/common/mapobjects/triggers.qh

index 4c40598d35339676829c7f1de7f69a92de7f5545..3666dd337b2c56ffed1b03ca54d1339dfe98d4e8 100644 (file)
@@ -98,7 +98,7 @@ void conveyor_init(entity this)
        setthink(this, conveyor_think);
        this.nextthink = time;
        this.setactive = generic_netlinked_setactive;
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
        {
                // backwards compatibility
                this.use = generic_netlinked_legacy_use;
index e9fd04b7263398217e507800c47261f50ab29696..57faf51455f18f0c47b5732dbf199045d73ed27d 100644 (file)
@@ -443,7 +443,7 @@ void LinkDoors(entity this)
 
                if (GetResource(this, RES_HEALTH))
                        return;
-               IFTARGETED
+               if(this.targetname && this.targetname != "")
                        return;
                if (this.items)
                        return;
@@ -511,7 +511,7 @@ void LinkDoors(entity this)
 
        if (GetResource(this, RES_HEALTH))
                return;
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
                return;
        if (this.items)
                return;
index c008e500dc1215a638c5c58215a4f1702890ec63..50593a4e2b071df0bbe2c6238157e59c3c6c8dde 100644 (file)
@@ -244,10 +244,7 @@ spawnfunc(func_door_secret)
        setblocked(this, secret_blocked);
        this.speed = 50;
        this.use = fd_secret_use;
-       IFTARGETED
-       {
-       }
-       else
+       if(!this.targetname || this.targetname == "")
                this.spawnflags |= DOOR_SECRET_YES_SHOOT;
 
        if (this.spawnflags & DOOR_SECRET_YES_SHOOT)
index 7de5a03ef8171e905ea0d7eff538580ad7e22f5e..72ad355987c2399bbcfd79d6682a4bd6d530207e 100644 (file)
@@ -115,7 +115,7 @@ spawnfunc(func_pointparticles)
 
        Net_LinkEntity(this, (this.spawnflags & PARTICLES_VISCULLING), 0, pointparticles_SendEntity);
 
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
        {
                // backwards compatibility
                this.use = generic_netlinked_legacy_use;
index df88b750f245dbc7000deccd0a6785bf5ae1a300..403a4681328e7e92de5b13f110d94fce6aff06e4 100644 (file)
@@ -280,7 +280,7 @@ spawnfunc(misc_laser)
 
        this.setactive = laser_setactive;
 
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
        {
                // backwards compatibility
                this.use = laser_use;
index e7eedd52c413474745eab4e7c142db34f14dba34..7402726d436a3dd8c06a8e4be045e32c853ab623 100644 (file)
@@ -39,10 +39,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
-       {
-       }
-       else
+       if(!this.targetname || this.targetname == "")
        {
                objerror (this, "^3Teleport destination without a targetname");
                return; // don't link it to CSQC in this case!
index 832b25b6b4e8f6513bd30655347ef0472f8c3468..aae20894d36a6e4bb39b3ff5aaf421f7617c9d8f 100644 (file)
@@ -179,7 +179,7 @@ void plat_use(entity this, entity actor, entity trigger)
 
 void plat_reset(entity this)
 {
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
        {
                setorigin(this, this.pos1);
                this.state = STATE_UP;
index 11c9ad7baef1d7c682feae42db5fa9162325532a..354f4ca6f6f2adbb3f6613d5d091f990dfc50784 100644 (file)
@@ -91,7 +91,7 @@ spawnfunc(target_speaker)
 
        if(!this.atten)
        {
-               IFTARGETED
+               if(this.targetname && this.targetname != "")
                        this.atten = ATTEN_NORM;
                else
                        this.atten = ATTEN_STATIC;
@@ -102,7 +102,7 @@ spawnfunc(target_speaker)
        if(!this.volume)
                this.volume = 1;
 
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
        {
                if(this.spawnflags & SPEAKER_ACTIVATOR)
                        this.use = target_speaker_use_activator;
index 1ac0f8768d5d355b1a4b0d8d7cea8f97935c6cf5..4b9fb2236b57a85d8f2bbac6dc8a53968677919e 100644 (file)
@@ -100,7 +100,7 @@ spawnfunc(trigger_gravity)
 
        this.active = ACTIVE_ACTIVE;
        this.setactive = generic_setactive;
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
        {
                // legacy use
                this.use = trigger_gravity_use;
index 932fda13ca94a5984f9e4d286848430147575158..34876aeb78e5a2276182415b6c750cb97bc30fd6 100644 (file)
@@ -72,7 +72,7 @@ spawnfunc(trigger_multivibrator)
        setthink(this, multivibrator_send_think);
        this.nextthink = max(1, time);
 
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
                multivibrator_reset(this);
 }
 #endif
index 27ffead9c7582bed0e81d63e1c99c926dc0d7980..29b00d5dbcc7f34932ae1154438d88688d1b6d14 100644 (file)
@@ -43,7 +43,7 @@ void generic_netlinked_setactive(entity this, int act)
 
 void generic_netlinked_reset(entity this)
 {
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
        {
                if(this.spawnflags & START_ENABLED)
                {
index 797c9767f6a084271f6b4ae64327d9ce8650caf6..73113b4b51c69b004e6eaf02e6d924a481fd815e 100644 (file)
@@ -8,8 +8,6 @@
 
 .float height;
 
-#define IFTARGETED if(this.targetname && this.targetname != "")
-
 .float lip;
 
 // used elsewhere (will fix)