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!
|
||||
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 page = params[3];
|
||||
|
@ -821,6 +822,12 @@ static cell AMX_NATIVE_CALL menu_display(AMX *amx, cell *params)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!g_NewMenus[handle])
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid menu id %d (was previously destroyed).", handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int time = -1;
|
||||
if (params[0] / sizeof(cell) >= 4)
|
||||
time = params[4];
|
||||
|
|
Loading…
Reference in New Issue
Block a user