Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent multiple calls to !stop or the use of it during backup pause #887

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripting/get5.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,10 @@ static Action Command_Stop(int client, int args) {
return Plugin_Handled;
}

if (g_GameState != Get5State_Live || g_PendingSideSwap == true) {
// Because a live restore to the same match does not change get5 state to warmup, we have to make sure
// that successive calls to !stop (spammed by players) does not reload multiple backups.
if (g_GameState != Get5State_Live || InHalftimePhase() || g_DoingBackupRestoreNow
|| g_PauseType == Get5PauseType_Backup) {
return Plugin_Handled;
}

Expand All @@ -1139,6 +1142,9 @@ static Action Command_Stop(int client, int args) {
}

Get5Team team = GetClientMatchTeam(client);
if (!IsPlayerTeam(team)) {
return Plugin_Handled;
}
g_TeamGivenStopCommand[team] = true;

char stopCommandFormatted[64];
Expand Down