From: Freddy Date: Sun, 11 Mar 2018 15:54:36 +0000 (+0100) Subject: target_spawn: replace magic number X-Git-Tag: xonotic-v0.8.5~2176^2~21 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=136376ad78915bb565145f777a623319c02888d0;p=xonotic%2Fxonotic-data.pk3dir.git target_spawn: replace magic number --- diff --git a/qcsrc/common/triggers/spawnflags.qh b/qcsrc/common/triggers/spawnflags.qh index 37551f2c6..b4a97de60 100644 --- a/qcsrc/common/triggers/spawnflags.qh +++ b/qcsrc/common/triggers/spawnflags.qh @@ -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); diff --git a/qcsrc/common/triggers/target/spawn.qc b/qcsrc/common/triggers/target/spawn.qc index 1464da955..9c999ed4d 100644 --- a/qcsrc/common/triggers/target/spawn.qc +++ b/qcsrc/common/triggers/target/spawn.qc @@ -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); }