Skip to content

Instantly share code, notes, and snippets.

diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index d3d427d..a191745 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1018,7 +1018,6 @@ minetest.setting_get(name) -> string or nil
minetest.setting_getbool(name) -> boolean value or nil
minetest.setting_get_pos(name) -> position or nil
minetest.setting_save() -> nil, save all settings to config file
-minetest.add_to_creative_inventory(itemstring)
diff --git a/src/script/lua_api/luaapi.cpp b/src/script/lua_api/luaapi.cpp
index 667a3af..e19c909 100644
--- a/src/script/lua_api/luaapi.cpp
+++ b/src/script/lua_api/luaapi.cpp
@@ -105,13 +105,31 @@ bool ModApiBasic::Initialize(lua_State* L,int top) {
return retval;
}
-// debug(text)
+// debug(...)
diff --git a/src/client.cpp b/src/client.cpp
index 5e682aa..ccd2034 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2850,6 +2850,7 @@ void Client::afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font)
m_tsrc->rebuildImagesAndTextures();
// Rebuild shaders
+ infostream<<"- Rebuilding shaders"<<std::endl;
m_shsrc->rebuildShaders();
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index 0aa2c2d..58008b8 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -61,6 +61,8 @@
}
+const double FS = 1.23;
+
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index 905e80e..29a2e23 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -659,8 +659,9 @@ void DecoSchematic::placeStructure(Map *map, v3s16 p) {
bool DecoSchematic::loadSchematicFile() {
std::ifstream is(filename.c_str(), std::ios_base::binary);
- u32 signature = readU32(is);
- if (signature != 'MTSM') {
diff --git a/src/biome.cpp b/src/biome.cpp
index 1963001..483e605 100644
--- a/src/biome.cpp
+++ b/src/biome.cpp
@@ -42,10 +42,20 @@
b->name = "Default";
b->flags = 0;
- b->c_top = CONTENT_AIR;
- b->depth_top = 0;
diff --git a/src/test.cpp b/src/test.cpp
index e609fe2..ddbcee7 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -164,6 +164,10 @@ struct TestUtilities: public TestBase
UASSERT(is_yes("YeS") == true);
UASSERT(is_yes("") == false);
UASSERT(is_yes("FAlse") == false);
+ UASSERT(is_yes("-1") == true);
+ UASSERT(is_yes("0") == false);
diff --git a/builtin/voxelarea.lua b/builtin/voxelarea.lua
index dd9af79..f546cd3 100644
--- a/builtin/voxelarea.lua
+++ b/builtin/voxelarea.lua
@@ -60,3 +60,28 @@ function VoxelArea:containsi(i)
return (i >= 1) and (i <= self:getVolume())
end
+function VoxelArea:iter(minx, miny, minz, maxx, maxy, maxz)
+ local i = self:index(minx, miny, minz) - 1
function VoxelArea:position(i)
i = i - 1
local x = i % self.ystride
local y = ((i-x) % self.zstride) / self.ystride
local z = (i - i % self.zstride) / self.zstride
return {
x = x + self.MinEdge.x,
y = y + self.MinEdge.y,
z = z + self.MinEdge.z
}
function VoxelArea:position(i)
local p = {}
i = i - 1
p.z = math.floor(i / self.zstride) + self.MinEdge.z
i = i % self.zstride
p.y = math.floor(i / self.ystride) + self.MinEdge.y
i = i % self.ystride