Skip to content

Commit

Permalink
Restart trigger_multiple (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
overl4y authored May 8, 2024
1 parent 75f142e commit d7f22ae
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 @@ -652,6 +652,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 @@ -283,6 +283,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 d7f22ae

Please sign in to comment.