fixing crash issue

This commit is contained in:
2025-05-22 15:18:18 +02:00
parent 01f2aaacde
commit 92967aac1f
8 changed files with 36 additions and 11 deletions

View File

@@ -7,6 +7,8 @@
std::memset(data.data(), static_cast<std::uint32_t>(BlockType::Air), data.size() * sizeof(std::uint32_t));
std::uint32_t height = std::abs(std::sin((float)pos.x / 20.0f) * std::cos((float)pos.y / 20.0f) * 60.0f) + 1;
// Must not exceed CHUNK_SIZE.y
for(std::uint32_t y = 0; y < std::min(height, CHUNK_SIZE.y); y++)
{
if(y > std::min(height, CHUNK_SIZE.y) - 2)