Skip to content

Commit

Permalink
fix; don't show /modes vote menu when mode is forced (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
wopox1337 authored Sep 12, 2023
1 parent 8346c9c commit 6d2b3b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
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

0 comments on commit 6d2b3b8

Please sign in to comment.