From f942162c619ae0b705026fa4e1434ea14484615f Mon Sep 17 00:00:00 2001 From: Nicolai Cornelis Date: Mon, 22 Aug 2022 18:11:56 +0200 Subject: [PATCH] Reset votes to restore when writing new backup Add message about resetting --- documentation/docs/translations.md | 3 ++- scripting/get5.sp | 10 ++++++++++ translations/da/get5.phrases.txt | 6 +++++- translations/get5.phrases.txt | 7 ++++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/documentation/docs/translations.md b/documentation/docs/translations.md index 9a25cb1ce..8a636fbda 100644 --- a/documentation/docs/translations.md +++ b/documentation/docs/translations.md @@ -104,6 +104,7 @@ end with a full stop as this is added automatically. | `TacticalPauseMidSentence` | _Team A_ (_CT_) __tactical pause__ (_1_/_2_). | HintText | | `TimeRemainingBeforeAnyoneCanUnpausePrefix` | _Team A_ (_CT_) technical pause (_1_/_2_). __Time remaining before anyone can unpause__: _2:30_ | HintText | | `StopCommandNotEnabled` | The stop command is not enabled. | Chat | +| `StopCommandVotingReset` | The request by _Team A_ to stop the game was canceled as a new round started. | Chat | | `PauseTimeRemainingPrefix` | _Team A_ (_CT_) tactical pause. __Remaining pause time__: _2:15_ | HintText | | `PausedForBackup` | The game was restored from a backup. Both teams must unpause to continue. | HintText | | `AwaitingUnpause` | _Team A_ (_CT_) tactical pause. __Awaiting unpause__. | HintText | @@ -132,7 +133,7 @@ end with a full stop as this is added automatically. | `AdminForceEndWithWinnerInfoMessage` | An admin force-ended the match, setting _Team 1_ as the winner. | Chat | | `AdminForcePauseInfoMessage` | An admin force-paused the match. | Chat | | `AdminForceUnPauseInfoMessage` | An admin unpaused the match. | Chat | -| `TeamWantsToReloadLastRoundInfoMessage` | _Team A_ wants to stop and reload last round. _Team B_ must confirm with _!stop_. | Chat | +| `TeamWantsToReloadLastRoundInfoMessage` | _Team A_ wants to restore the game to the beginning of the current round. _Team B_ must confirm with _!stop_. | Chat | | `TeamWinningSeriesInfoMessage` | _Team A_ is winning the series _2_-_1_. | Chat | | `SeriesTiedInfoMessage` | The series is tied at _1_-_1_. | Chat | | `NextSeriesMapInfoMessage` | The next map in the series is _de_nuke_ and it will start in _1:30_. | Chat | diff --git a/scripting/get5.sp b/scripting/get5.sp index 71a52af06..5cbff9141 100644 --- a/scripting/get5.sp +++ b/scripting/get5.sp @@ -1527,6 +1527,16 @@ public void WriteBackup() { LogDebug("Writing backup to %s", path); WriteBackStructure(path); g_LastGet5BackupCvar.SetString(path); + + // Reset this when writing a new backup, as voting has no reference to which round the teams wanted to restore to, so + // votes to restore during one round should not carry over into the next round, as it would just restore that round + // instead. + LOOP_TEAMS(t) { + if (g_TeamGivenStopCommand[t]) { + Get5_MessageToAll("%t", "StopCommandVotingReset", g_FormattedTeamNames[t]); + } + g_TeamGivenStopCommand[t] = false; + } } public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast) { diff --git a/translations/da/get5.phrases.txt b/translations/da/get5.phrases.txt index 3f826317e..6a6d5814b 100644 --- a/translations/da/get5.phrases.txt +++ b/translations/da/get5.phrases.txt @@ -218,7 +218,7 @@ } "TeamWantsToReloadLastRoundInfoMessage" { - "da" "{1} vil stoppe og genindlæse sidste runde. Afventer {3} fra {2}." + "da" "{1} vil stoppe og genindlæse til starten af denne runde. Afventer {3} fra {2}." } "TeamWinningSeriesInfoMessage" { @@ -252,6 +252,10 @@ { "da" "Stop-kommandoen er ikke aktiveret." } + "StopCommandVotingReset" + { + "da" "Anmodningen fra {1} om at stoppe spillet blev annulleret, da en ny runde startede." + } "BackupLoadedInfoMessage" { "da" "Backup {1} indlæst." diff --git a/translations/get5.phrases.txt b/translations/get5.phrases.txt index 054cecb41..8e6393856 100644 --- a/translations/get5.phrases.txt +++ b/translations/get5.phrases.txt @@ -261,7 +261,7 @@ "TeamWantsToReloadLastRoundInfoMessage" { "#format" "{1:s},{2:s},{3:s}" - "en" "{1} wants to stop and reload last round. {2} must confirm with {3}." + "en" "{1} wants to restore the game to the beginning of the current round. {2} must confirm with {3}." } "TeamWinningSeriesInfoMessage" { @@ -301,6 +301,11 @@ { "en" "The stop command is not enabled." } + "StopCommandVotingReset" + { + "#format" "{1:s}" + "en" "The request by {1} to stop the game was canceled as a new round started." + } "BackupLoadedInfoMessage" { "#format" "{1:s}"