From 9bcbb734b0cdf45cd85d4e4b436d7a1c08557598 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 2 Oct 2018 17:18:28 +1000 Subject: [PATCH] C client: Fix garbage blocks with inf id in rare case small map, initially purely classic blocks only (so no upper array is sent by server), and you then tried to place a block above 256 --- src/World.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/World.c b/src/World.c index ae31c62f3..1c3fdc6d2 100644 --- a/src/World.c +++ b/src/World.c @@ -70,7 +70,7 @@ void World_SetBlock(Int32 x, Int32 y, Int32 z, BlockID block) { /* defer allocation of second map array if possible */ if (World_Blocks == World_Blocks2) { if (block < 256) return; - World_Blocks2 = Mem_Alloc(World_BlocksSize, 1, "blocks array upper"); + World_Blocks2 = Mem_AllocCleared(World_BlocksSize, 1, "blocks array upper"); Block_SetUsedCount(768); } World_Blocks2[i] = (BlockRaw)(block >> 8);