Modernize lua read (part 2 & 3): C++ templating assurance (#7410)
* Modernize lua read (part 2 & 3): C++ templating assurance Implement the boolean reader Implement the string reader Also remove unused & unimplemented script_error_handler Add a reader with default value
This commit is contained in:
@@ -508,7 +508,7 @@ int ModApiItemMod::l_register_item_raw(lua_State *L)
|
||||
std::string name;
|
||||
lua_getfield(L, table, "name");
|
||||
if(lua_isstring(L, -1)){
|
||||
name = lua_tostring(L, -1);
|
||||
name = readParam<std::string>(L, -1);
|
||||
verbosestream<<"register_item_raw: "<<name<<std::endl;
|
||||
} else {
|
||||
throw LuaError("register_item_raw: name is not defined or not a string");
|
||||
|
||||
Reference in New Issue
Block a user