Require cb_ prefix for plans
This commit is contained in:
@@ -58,6 +58,9 @@ LuaDefine(gui_menu_item, "action,label", "add a menu item to the current gui") {
|
||||
LuaStack LS(L, laction, llabel);
|
||||
std::string action = LS.ckstring(laction);
|
||||
std::string label = LS.ckstring(llabel);
|
||||
if (!util::has_prefix(action, "cb_")) {
|
||||
luaL_error(L, "menuitem callbacks must start with cb_");
|
||||
}
|
||||
gui->menu_item(action, label);
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user