Skip to content

Commit

Permalink
Restart trigger_multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
techhex committed Jan 25, 2024
1 parent 4b49f63 commit 09d6f41
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions regamedll/dlls/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)()
UTIL_RestartOther("env_beam");
UTIL_RestartOther("env_laser");
UTIL_RestartOther("trigger_auto");
UTIL_RestartOther("trigger_multiple");
#endif

// Remove grenades and C4
Expand Down
8 changes: 8 additions & 0 deletions regamedll/dlls/triggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,14 @@ void CTriggerMultiple::Spawn()
}
}

#ifdef REGAMEDLL_FIXES
void CTriggerMultiple::Restart()
{
pev->nextthink = -1;
Spawn();
}
#endif

LINK_ENTITY_TO_CLASS(trigger_once, CTriggerOnce, CCSTriggerOnce)

void CTriggerOnce::Spawn()
Expand Down
4 changes: 4 additions & 0 deletions regamedll/dlls/triggers.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ class CTriggerMultiple: public CBaseTrigger
{
public:
virtual void Spawn();

#ifdef REGAMEDLL_FIXES
virtual void Restart();
#endif
};

// Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching
Expand Down

0 comments on commit 09d6f41

Please sign in to comment.