Merge branch 'MihailRis:main' into main

This commit is contained in:
Astazium 2026-08-29 14:40:20 +03:00 • committed by GitHub
commit 533a27c04b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -145,6 +145,9 @@ private:
// Does block allow to see other blocks sides (is it transparent) // Does block allow to see other blocks sides (is it transparent)
bool isOpen(const glm::ivec3& pos, const Block& def, const Variant& variant) const { 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( const auto& vox = voxelsBuffer->pickBlock(
chunk->x * CHUNK_W + pos.x, pos.y, chunk->z * CHUNK_D + pos.z chunk->x * CHUNK_W + pos.x, pos.y, chunk->z * CHUNK_D + pos.z
); );

View file

@ -51,7 +51,7 @@ static std::unique_ptr<xml::xmlelement> toxml(lua::State* L) {
break; break;
} }
auto key = lua::require_lstring(L, -1); auto key = lua::require_lstring(L, -1);
if (key == "@") { if (key == TAG_ATTR) {
break; break;
} }
auto value = lua::require_lstring(L, -2); auto value = lua::require_lstring(L, -2);

View file

@ -128,11 +128,10 @@ static int l_noise(lua::State* L) {
} }
float noiseValue = fnlGetNoise2D(noise, u, v); float noiseValue = fnlGetNoise2D(noise, u, v);
float t = 1.0f / static_cast<float>(1 << c) * multiplier;
if (normalizedNoise) { if (normalizedNoise) {
float t = 1.0f / (static_cast<float>(1 << c) * multiplier);
value = value * (1.0f - t) + noiseValue * t; value = value * (1.0f - t) + noiseValue * t;
} else { } else {
float t = 1.0f / static_cast<float>(1 << c) * multiplier;
value += noiseValue * t; value += noiseValue * t;
} }
heights[i] = value; heights[i] = value;