From 478fd678c83e78a42fd2c4d901bb5da2349fa239 Mon Sep 17 00:00:00 2001 From: mcfx0 Date: Tue, 18 Feb 2020 16:48:14 +0800 Subject: [PATCH] Fix wrong behavior when data covers two adjacent int64 in fillSection --- bot/world/chunk.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/world/chunk.go b/bot/world/chunk.go index 572d94f..2d2a97a 100644 --- a/bot/world/chunk.go +++ b/bot/world/chunk.go @@ -82,8 +82,8 @@ func fillSection(s *Section, bpb uint, DataArray []int64, palette []uint) { data := uint(DataArray[offset/64]) data >>= offset % 64 if offset%64 > 64-bpb { - l := bpb + offset%64 - 64 - data &= uint(DataArray[offset/64+1] << l) + l := 64 - offset % 64 + data |= uint(DataArray[offset/64+1] << l) } data &= mask