info_tfgoal: add hack to make some maps work with possible bugs work better

This commit is contained in:
Marco Cawthorne 2023-01-23 02:22:25 -08:00
parent c033b256ea
commit 8aba849f6b
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 18 additions and 2 deletions

View File

@ -112,8 +112,20 @@ class info_tfgoal:NSRenderableEntity
virtual void(entity) Touch; virtual void(entity) Touch;
virtual void(void) Respawn; virtual void(void) Respawn;
virtual void(string, string) SpawnKey; 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 void
info_tfgoal::Touch(entity eToucher) info_tfgoal::Touch(entity eToucher)
{ {
@ -125,13 +137,17 @@ info_tfgoal::Touch(entity eToucher)
player pl = (player)eToucher; player pl = (player)eToucher;
/* check for state */ /* check for state */
if (m_tfgState != TFGOAL_INACTIVE) if (m_tfgState != TFGOAL_INACTIVE) {
print("not active\n");
return; return;
}
/* check for team eligibility */ /* check for team eligibility */
if (m_iTeamUses) if (m_iTeamUses)
if (eToucher.team != m_iTeamUses) if (eToucher.team != m_iTeamUses) {
print("not eligble\n");
return; return;
}
/* check for the must-have carry */ /* check for the must-have carry */
if (m_dMustCarry) { if (m_dMustCarry) {