mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Add AreaStore custom ID API
This commit is contained in:
@@ -164,7 +164,7 @@ int LuaAreaStore::l_get_areas_in_area(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// insert_area(edge1, edge2, data)
|
||||
// insert_area(edge1, edge2, data, id)
|
||||
int LuaAreaStore::l_insert_area(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
@@ -179,6 +179,9 @@ int LuaAreaStore::l_insert_area(lua_State *L)
|
||||
|
||||
a.data = std::string(data, d_len);
|
||||
|
||||
if (lua_isnumber(L, 5))
|
||||
a.id = lua_tonumber(L, 5);
|
||||
|
||||
if (!ast->insertArea(&a))
|
||||
return 0;
|
||||
|
||||
|
Reference in New Issue
Block a user