diff --git a/src/graphics/render/BlocksRenderer.hpp b/src/graphics/render/BlocksRenderer.hpp index 0488f0080..819e79bca 100644 --- a/src/graphics/render/BlocksRenderer.hpp +++ b/src/graphics/render/BlocksRenderer.hpp @@ -145,6 +145,9 @@ private: // Does block allow to see other blocks sides (is it transparent) bool isOpen(const glm::ivec3& pos, const Block& def, const Variant& variant) const { + if (pos.y >= CHUNK_H) { + return true; + } const auto& vox = voxelsBuffer->pickBlock( chunk->x * CHUNK_W + pos.x, pos.y, chunk->z * CHUNK_D + pos.z ); diff --git a/src/logic/scripting/lua/libs/libxml.cpp b/src/logic/scripting/lua/libs/libxml.cpp index 139e0ee35..4aa11f3dd 100644 --- a/src/logic/scripting/lua/libs/libxml.cpp +++ b/src/logic/scripting/lua/libs/libxml.cpp @@ -51,7 +51,7 @@ static std::unique_ptr toxml(lua::State* L) { break; } auto key = lua::require_lstring(L, -1); - if (key == "@") { + if (key == TAG_ATTR) { break; } auto value = lua::require_lstring(L, -2); diff --git a/src/logic/scripting/lua/usertypes/lua_type_heightmap.cpp b/src/logic/scripting/lua/usertypes/lua_type_heightmap.cpp index 6ae6a0d8d..9926ec18e 100644 --- a/src/logic/scripting/lua/usertypes/lua_type_heightmap.cpp +++ b/src/logic/scripting/lua/usertypes/lua_type_heightmap.cpp @@ -128,11 +128,10 @@ static int l_noise(lua::State* L) { } float noiseValue = fnlGetNoise2D(noise, u, v); + float t = 1.0f / static_cast(1 << c) * multiplier; if (normalizedNoise) { - float t = 1.0f / (static_cast(1 << c) * multiplier); value = value * (1.0f - t) + noiseValue * t; } else { - float t = 1.0f / static_cast(1 << c) * multiplier; value += noiseValue * t; } heights[i] = value;