Skip to content

Commit

Permalink
Update readyup.smx (#799)
Browse files Browse the repository at this point in the history
- Added function to re-spectate spectators after the round starts to fix score bug for spectators, specifically for casters
  • Loading branch information
theletterjwithadot authored Aug 12, 2024
1 parent 176c439 commit b2a47fd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Binary file modified addons/sourcemod/plugins/optional/readyup.smx
Binary file not shown.
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/readyup.sp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#undef REQUIRE_PLUGIN
#include <caster_system>

#define PLUGIN_VERSION "10.2.4"
#define PLUGIN_VERSION "10.2.5"

public Plugin myinfo =
{
Expand Down
12 changes: 12 additions & 0 deletions addons/sourcemod/scripting/readyup/action.inc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static Action ReadyCountdownDelay_Timer(Handle timer)
InitiateLive();
PlayLiveSound();
s_readyCountdownTimer = null;
RespectateSpectators(); //# Fix score bug for spectators, specifically for casters
return Plugin_Stop;
}

Expand Down Expand Up @@ -251,3 +252,14 @@ void CancelFullReady(int client, disruptType type)
}
}
}

void RespectateSpectators()
{
for (int client = 1; client <= MaxClients; ++client)
{
if (IsClientInGame(client) && !IsFakeClient(client) && GetClientTeam(client) == L4D2Team_Spectator )
{
FakeClientCommand(client, "sm_spectate");
}
}
}

0 comments on commit b2a47fd

Please sign in to comment.