]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove magic numbers in misc_follow
authorFreddy <schro.sb@gmail.com>
Sat, 10 Mar 2018 15:26:39 +0000 (16:26 +0100)
committerFreddy <schro.sb@gmail.com>
Sat, 10 Mar 2018 15:26:39 +0000 (16:26 +0100)
qcsrc/common/triggers/misc/follow.qc
qcsrc/common/triggers/misc/follow.qh
qcsrc/common/triggers/spawnflags.qh

index 63db2c18fa83ac172f62dce5a7b187fccc0c63c4..87619ca711097ff116907c36dc1a34acf0f3ddbd 100644 (file)
@@ -29,10 +29,10 @@ void follow_init(entity this)
                objerror(this, "follow: could not find target/killtarget");
                return;
        }
-       else if(this.spawnflags & 1)
+       else if(this.spawnflags & FOLLOW_ATTACH)
        {
                // attach
-               if(this.spawnflags & 2)
+               if(this.spawnflags & FOLLOW_LOCAL)
                {
                        setattachment(dst, src, this.message);
                }
@@ -46,7 +46,7 @@ void follow_init(entity this)
        }
        else
        {
-               if(this.spawnflags & 2)
+               if(this.spawnflags & FOLLOW_LOCAL)
                {
                        set_movetype(dst, MOVETYPE_FOLLOW);
                        dst.aiment = src;
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..7c39519e10e9f29d62f38ee0bc76f0dd4b0ed584 100644 (file)
@@ -1 +1,2 @@
 #pragma once
+#include "../spawnflags.qh"
index 7eac4991756dffd47f21e385bdfedb4f4427428d..8c32ef9c9d08a528f8171a8c4345086d5cc048b0 100644 (file)
@@ -67,6 +67,10 @@ const int PROJECT_ON_TARGET2NORMAL = BIT(1);
 const int PROJECT_ON_TARGET3NORMAL = BIT(2);
 const int PROJECT_ON_TARGET4NORMAL = BIT(3);
 
+// follow
+const int FOLLOW_ATTACH = BIT(0);
+const int FOLLOW_LOCAL = BIT(1);
+
 // platforms
 const int PLAT_LOW_TRIGGER = BIT(0);
 const int PLAT_CRUSH = BIT(2);