]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
target_spawn: replace magic number
authorFreddy <schro.sb@gmail.com>
Sun, 11 Mar 2018 15:54:36 +0000 (16:54 +0100)
committerFreddy <schro.sb@gmail.com>
Sun, 11 Mar 2018 15:54:36 +0000 (16:54 +0100)
qcsrc/common/triggers/spawnflags.qh
qcsrc/common/triggers/target/spawn.qc

index 37551f2c6c95fc75e13bfeb9fd7dad0670519e27..b4a97de60c29dabae051548e70880b20c44b717a 100644 (file)
@@ -1,8 +1,9 @@
 #pragma once
 
 // generic usage
-const int NOSPLASH = BIT(8); // generic anti-splashdamage spawnflag
 const int START_ENABLED = BIT(0);
+const int ON_MAPLOAD = BIT(1);
+const int NOSPLASH = BIT(8); // generic anti-splashdamage spawnflag
 
 // bobbing
 const int BOBBING_XAXIS = BIT(0);
index 1464da95511260b8ce4592e705b50bf9a62e7c2d..9c999ed4df4758612b9052a34aeb22101b85b905 100644 (file)
@@ -12,8 +12,7 @@
 // "classname" "target_spawn"
 // "message" "fieldname value fieldname value ..."
 // "spawnflags"
-//   1 = call the spawn function
-//   2 = trigger on map load
+//   ON_MAPLOAD = trigger on map load
 
 float target_spawn_initialized;
 .void(entity this) target_spawn_spawnfunc;
@@ -298,7 +297,7 @@ void target_spawn_use(entity this, entity actor, entity trigger)
 void target_spawn_spawnfirst(entity this)
 {
        entity act = this.target_spawn_activator;
-       if(this.spawnflags & 2)
+       if(this.spawnflags & ON_MAPLOAD)
                target_spawn_use(this, act, NULL);
 }