mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-02-10 13:58:56 +03:00
Fix a crash on the same newmenu overlapping (#462)
This commit is contained in:
parent
361a6cc9e0
commit
97df408d51
@ -809,7 +809,8 @@ static cell AMX_NATIVE_CALL menu_items(AMX *amx, cell *params)
|
|||||||
//page indices start at 0!
|
//page indices start at 0!
|
||||||
static cell AMX_NATIVE_CALL menu_display(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL menu_display(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
GETMENU(params[2]);
|
auto handle = params[2];
|
||||||
|
GETMENU(handle);
|
||||||
|
|
||||||
int player = params[1];
|
int player = params[1];
|
||||||
int page = params[3];
|
int page = params[3];
|
||||||
@ -821,6 +822,12 @@ static cell AMX_NATIVE_CALL menu_display(AMX *amx, cell *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!g_NewMenus[handle])
|
||||||
|
{
|
||||||
|
LogError(amx, AMX_ERR_NATIVE, "Invalid menu id %d (was previously destroyed).", handle);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int time = -1;
|
int time = -1;
|
||||||
if (params[0] / sizeof(cell) >= 4)
|
if (params[0] / sizeof(cell) >= 4)
|
||||||
time = params[4];
|
time = params[4];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user