Skip to content

Commit

Permalink
fix: kill timers on map end (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushaway authored Mar 6, 2024
1 parent 7637d33 commit aed4025
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/addons/sourcemod/scripting/zombiereloaded.sp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#include <sdkhooks>

#define VERSION "3.10.1"
#define VERSION "3.10.2"

// Comment this line to exclude version info command. Enable this if you have
// the repository and HG installed (Mercurial or TortoiseHG).
Expand Down Expand Up @@ -242,6 +242,8 @@ public void OnMapEnd()
VEffectsOnMapEnd();
ZombieSoundsOnMapEnd();
ImmunityOnMapEnd();
OverlaysOnMapEnd();
SEffectsOnMapEnd();
}

/**
Expand Down
13 changes: 13 additions & 0 deletions src/addons/sourcemod/scripting/zr/overlays.inc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ void OverlaysOnMapStart()
tOverlays = INVALID_HANDLE;
}

/**
* Map is ending.
*/
void OverlaysOnMapEnd()
{
// If timer is running, kill it.
if (tOverlays != INVALID_HANDLE)
{
KillTimer(tOverlays);
tOverlays = INVALID_HANDLE;
}
}

/**
* Client is joining the server.
*
Expand Down
13 changes: 13 additions & 0 deletions src/addons/sourcemod/scripting/zr/soundeffects/soundeffects.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ void SEffectsOnMapStart()
AmbientSoundsOnMapStart();
}

/**
* Map is ending.
*/
void SEffectsOnMapEnd()
{
// If timer is running, kill it.
if (tAmbientSounds != INVALID_HANDLE)
{
KillTimer(tAmbientSounds);
tAmbientSounds = INVALID_HANDLE;
}
}

/**
* Client is joining the server.
*
Expand Down

0 comments on commit aed4025

Please sign in to comment.