Skip to content

Commit

Permalink
Add pause state handling to game info synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
altair-sossai committed Nov 16, 2024
1 parent 1623e25 commit ca2c4a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Binary file modified addons/sourcemod/plugins/optional/l4d2_gameinfo_sync.smx
Binary file not shown.
12 changes: 12 additions & 0 deletions addons/sourcemod/scripting/l4d2_gameinfo_sync.sp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <sdktools>
#include <left4dhooks>
#include <ripext>
#include <pause>
#include <readyup>
#include <l4d2util>
#include <colors>
Expand Down Expand Up @@ -69,6 +70,16 @@ public void OnRoundIsLive()
CreateTimer(2.0, OnRoundIsLive_Timer);
}

public void OnPause()
{
SendRound();
}

public void OnUnpause()
{
SendRound();
}

public void L4D2_OnEndVersusModeRound_Post()
{
g_bInTransition = true;
Expand Down Expand Up @@ -202,6 +213,7 @@ void SendRound()
g_iWitchPercent = GetStoredWitchPercent();

command.SetBool("isInReady", IsInReady());
command.SetBool("isInPause", IsInPause());
command.SetBool("areTeamsFlipped", GameRules_GetProp("m_bAreTeamsFlipped") ? true : false);
command.SetInt("maxChapterProgressPoints", L4D_GetVersusMaxCompletionScore());
command.SetFloat("tankPercent", g_iTankPercent / 100.0);
Expand Down

0 comments on commit ca2c4a7

Please sign in to comment.