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
This commit is contained in:
UnknownShadow200 2018-10-02 17:18:28 +10:00
parent bc10416f97
commit 9bcbb734b0

View File

@ -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);