add chunk data validity check to world.set_chunk_data

This commit is contained in:
MihailRis
2025-01-31 12:41:49 +03:00
parent 1e851b05b4
commit b00160eb26
3 changed files with 25 additions and 4 deletions
+2 -1
View File
@@ -5,6 +5,7 @@
#include "api_lua.hpp"
#include "assets/AssetsLoader.hpp"
#include "coders/json.hpp"
#include "content/Content.hpp"
#include "engine/Engine.hpp"
#include "files/WorldFiles.hpp"
#include "files/engine_paths.hpp"
@@ -181,7 +182,7 @@ static int l_set_chunk_data(lua::State* L) {
return lua::pushboolean(L, false);
}
compressed_chunks::decode(
*chunk, buffer.data(), buffer.size()
*chunk, buffer.data(), buffer.size(), *content->getIndices()
);
if (controller->getChunksController()->lighting == nullptr) {
return lua::pushboolean(L, true);