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

fix: don't show /modes vote menu when mode is forced #41

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public MenuHandler_Modes(const player, const menu, const item) {

new modeIdx = (item - 1)

RoundModes_SetCurrentMode(modeIdx)
RoundModes_SetForcedMode(modeIdx)

rg_round_end(
CHalfLifeMultiplay__GetRoundRestartDelay(),
Expand Down
3 changes: 3 additions & 0 deletions cstrike/addons/amxmodx/scripting/ReDeathmatch/Modes/Vote.inc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ bool: ModeVote_RoundEnd_Post() {
if (!get_playersnum_ex(GetPlayers_ExcludeBots | GetPlayers_ExcludeHLTV))
return false

if (IsModeForced())
return false

VoteStart(redm_mode_vote_time)

return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ RoundModes_GetCurrentMode() {
return g_forcedModeIdx > -1 ? g_forcedModeIdx : g_currentRoundModeIdx
}

RoundModes_SetCurrentMode(const modeIdx) {
g_currentRoundModeIdx = modeIdx
RoundModes_SetForcedMode(const modeIdx = -1) {
g_forcedModeIdx = modeIdx
}

RoundModes_ResetCurrentMode() {
Expand Down