From 136376ad78915bb565145f777a623319c02888d0 Mon Sep 17 00:00:00 2001 From: Freddy Date: Sun, 11 Mar 2018 16:54:36 +0100 Subject: [PATCH] target_spawn: replace magic number --- qcsrc/common/triggers/spawnflags.qh | 3 ++- qcsrc/common/triggers/target/spawn.qc | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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); } -- 2.39.2