diff --git a/amxmodx/newmenus.cpp b/amxmodx/newmenus.cpp index 126bee66..359204b4 100755 --- a/amxmodx/newmenus.cpp +++ b/amxmodx/newmenus.cpp @@ -84,6 +84,7 @@ Menu::Menu(const char *title, int mid, int tid) m_OptOrders[2] = MENU_EXIT; m_AlwaysExit = false; + m_NeverExit = false; m_AutoColors = g_coloredmenus; items_per_page = 7; @@ -238,7 +239,7 @@ const char *Menu::GetTextString(int player, page_t page, int &keys) } else { end = start + items_per_page - 1; } - if (m_AlwaysExit || (page == 0 || page == pages-1)) + if (!m_NeverExit && (m_AlwaysExit || (page == 0 || page == pages-1))) flags |= Display_Exit; } else { end = numItems - 1; @@ -617,7 +618,18 @@ static cell AMX_NATIVE_CALL menu_setprop(AMX *amx, cell *params) } case MPROP_EXITALL: { - pMenu->m_AlwaysExit = *get_amxaddr(amx, params[3]) ? true : false; + cell ans = *get_amxaddr(amx, params[3]); + if (ans == 1) + { + pMenu->m_AlwaysExit = true; + pMenu->m_NeverExit = false; + } else if (ans == 0) { + pMenu->m_AlwaysExit = false; + pMenu->m_NeverExit = false; + } else if (ans == -1) { + pMenu->m_NeverExit = true; + pMenu->m_AlwaysExit = false; + } break; } case MPROP_ORDER: diff --git a/amxmodx/newmenus.h b/amxmodx/newmenus.h index 5ee8e3a3..f6eba703 100755 --- a/amxmodx/newmenus.h +++ b/amxmodx/newmenus.h @@ -45,7 +45,7 @@ #define MPROP_NEXTNAME 3 #define MPROP_EXITNAME 4 #define MPROP_TITLE 5 -#define MPROP_EXITALL 6 +#define MPROP_EXITALL 6 #define MPROP_ORDER 7 #define MPROP_NOCOLORS 8 @@ -93,6 +93,7 @@ public: int m_OptOrders[3]; bool m_AlwaysExit; + bool m_NeverExit; bool m_AutoColors; int menuId;