Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
Disable 'always give random weapons' flag if other option has been se…
Browse files Browse the repository at this point in the history
…lected from the menu (#39)
  • Loading branch information
etojuice authored Sep 17, 2021
1 parent 4fb2e71 commit 98c23d0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ public ClCmd_EnableMenu(const pPlayer)

client_print_color(pPlayer, print_team_blue, "^4[CSDM] %L", pPlayer, "MENU_WILL_BE_OPENED")
g_bOpenMenu[pPlayer] = true
g_bAlwaysRandom[pPlayer] = false

return PLUGIN_HANDLED
}
Expand Down Expand Up @@ -331,21 +330,25 @@ public MenuHandler_EquipMenu(const pPlayer, const menu, const item) {
switch(item) {
case em_newWeapons: {
g_iNumSecondary ? MenuShow_SecondaryWeapons(pPlayer) : MenuShow_PrimaryWeapons(pPlayer)
g_bAlwaysRandom[pPlayer] = false
}
case em_previous: {
PreviousWeapons(pPlayer, g_aArrays[Secondary], g_iPreviousSecondary[pPlayer])
PreviousWeapons(pPlayer, g_aArrays[Primary], g_iPreviousPrimary[pPlayer])
g_bAlwaysRandom[pPlayer] = false
}
case em_dontShowAgain: {
PreviousWeapons(pPlayer, g_aArrays[Secondary], g_iPreviousSecondary[pPlayer])
PreviousWeapons(pPlayer, g_aArrays[Primary], g_iPreviousPrimary[pPlayer])

client_print_color(pPlayer, print_team_grey, "^4[CSDM] %L", pPlayer, "CHAT_HELP_GUNS")
g_bOpenMenu[pPlayer] = false
g_bAlwaysRandom[pPlayer] = false
}
case em_random: {
g_iPreviousSecondary[pPlayer] = RandomWeapons(pPlayer, g_aArrays[Secondary], g_iNumSecondary)
g_iPreviousPrimary[pPlayer] = RandomWeapons(pPlayer, g_aArrays[Primary], g_iNumPrimary)
g_bAlwaysRandom[pPlayer] = false
}
case em_always_random: {
g_iPreviousSecondary[pPlayer] = RandomWeapons(pPlayer, g_aArrays[Secondary], g_iNumSecondary)
Expand Down

0 comments on commit 98c23d0

Please sign in to comment.