Ensure menu ID is valid for active_menu
This commit is contained in:
parent
8dfa09bf6a
commit
ac2912f2d2
@ -855,12 +855,12 @@ int luatpt_airheat(lua_State* l)
|
|||||||
}
|
}
|
||||||
int luatpt_active_menu(lua_State* l)
|
int luatpt_active_menu(lua_State* l)
|
||||||
{
|
{
|
||||||
int aheatstate;
|
int menuid;
|
||||||
aheatstate = luaL_optint(l, 1, menu_count);
|
menuid = luaL_optint(l, 1, 0);
|
||||||
if (aheatstate < SC_TOTAL)
|
if (menuid < SC_TOTAL && menuid > 0)
|
||||||
active_menu = aheatstate;
|
active_menu = menuid;
|
||||||
else
|
else
|
||||||
return luaL_error(l, "Menu does not exist");
|
return luaL_error(l, "Invalid menu");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int luatpt_decorations_enable(lua_State* l)
|
int luatpt_decorations_enable(lua_State* l)
|
||||||
|
Reference in New Issue
Block a user