From 8aba849f6bd9d75b43e58560239e7c15e022fbb9 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Mon, 23 Jan 2023 02:22:25 -0800 Subject: [PATCH] info_tfgoal: add hack to make some maps work with possible bugs work better --- src/server/info_tfgoal.qc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/server/info_tfgoal.qc b/src/server/info_tfgoal.qc index ffbdd5a..3dbc064 100644 --- a/src/server/info_tfgoal.qc +++ b/src/server/info_tfgoal.qc @@ -112,8 +112,20 @@ class info_tfgoal:NSRenderableEntity virtual void(entity) Touch; virtual void(void) Respawn; virtual void(string, string) SpawnKey; + virtual void Spawned(void); }; +void +info_tfgoal::Spawned(void) +{ + super::Spawned(); + + /* HACK: goals without a targetname and TFGOAL_REMOVED can't work */ + if (m_tfgState == TFGOAL_REMOVED && !targetname) { + m_tfgState = TFGOAL_INACTIVE; + } +} + void info_tfgoal::Touch(entity eToucher) { @@ -125,13 +137,17 @@ info_tfgoal::Touch(entity eToucher) player pl = (player)eToucher; /* check for state */ - if (m_tfgState != TFGOAL_INACTIVE) + if (m_tfgState != TFGOAL_INACTIVE) { + print("not active\n"); return; + } /* check for team eligibility */ if (m_iTeamUses) - if (eToucher.team != m_iTeamUses) + if (eToucher.team != m_iTeamUses) { + print("not eligble\n"); return; + } /* check for the must-have carry */ if (m_dMustCarry) {