aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_areastore.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2015-10-30 20:38:22 -0400
committerShadowNinja <shadowninja@minetest.net>2016-03-07 16:33:20 -0500
commit3ce6642a26d43fd368c24cdfc5460557258fb44f (patch)
tree3f84e8a4491abc6c9bc4a615dea018fdd8cf0697 /src/script/lua_api/l_areastore.cpp
parent821551a2669123ac9a476894d65b5efe10026040 (diff)
downloadminetest-3ce6642a26d43fd368c24cdfc5460557258fb44f.tar.gz
minetest-3ce6642a26d43fd368c24cdfc5460557258fb44f.tar.bz2
minetest-3ce6642a26d43fd368c24cdfc5460557258fb44f.zip
Add AreaStore custom ID API
Diffstat (limited to 'src/script/lua_api/l_areastore.cpp')
-rw-r--r--src/script/lua_api/l_areastore.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/script/lua_api/l_areastore.cpp b/src/script/lua_api/l_areastore.cpp
index 261baf6c9..20e7875c7 100644
--- a/src/script/lua_api/l_areastore.cpp
+++ b/src/script/lua_api/l_areastore.cpp
@@ -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;