From 43a86a0efe61c3c426a55fa3c9928d64399fa377 Mon Sep 17 00:00:00 2001 From: Lars Date: Tue, 20 May 2025 13:48:35 -0700 Subject: [PATCH] getBlockNodeIdMapping signature --- src/mapblock.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mapblock.cpp b/src/mapblock.cpp index fcde1a5d1..34d039994 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -297,12 +297,12 @@ void MapBlock::expireIsAirCache() // Note that there's no technical reason why we *have to* renumber the IDs, // but we do it anyway as it also helps compressability. static void getBlockNodeIdMapping(NameIdMapping *nimap, MapNode *nodes, - const NodeDefManager *nodedef, bool is_mono_block) + const NodeDefManager *nodedef, u32 nodecount) { IdIdMapping &mapping = IdIdMapping::giveClearedThreadLocalInstance(); content_t id_counter = 0; - for (u32 i = 0; i < (is_mono_block ? 1 : MapBlock::nodecount); i++) { + for (u32 i = 0; i < nodecount; i++) { content_t global_id = nodes[i].getContent(); content_t id = CONTENT_IGNORE; @@ -424,7 +424,7 @@ void MapBlock::serialize(std::ostream &os_compressed, u8 version, bool disk, int tmp_nodes = new MapNode[nodecount]; memcpy(tmp_nodes, data, nodecount * sizeof(MapNode)); } - getBlockNodeIdMapping(&nimap, tmp_nodes, m_gamedef->ndef(), m_is_mono_block); + getBlockNodeIdMapping(&nimap, tmp_nodes, m_gamedef->ndef(), m_is_mono_block ? 1 : nodecount); buf = MapNode::serializeBulk(version, tmp_nodes, nodecount, content_width, params_width, m_is_mono_block);