From ba048e2101d42af53f2ac7a9a3ed04c194918136 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 3 Apr 2020 20:24:49 +0000 Subject: New hotfix to prevent calling OnBroken (#4600) * Fix stack overflow in breaking ice. Stupid fix, but it does work and is used in other places too... * Replace hotfix for pistons with better one * Fix comments in BlockBed handler --- src/Blocks/BlockIce.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Blocks/BlockIce.h') diff --git a/src/Blocks/BlockIce.h b/src/Blocks/BlockIce.h index 672288ca3..a39162d79 100644 --- a/src/Blocks/BlockIce.h +++ b/src/Blocks/BlockIce.h @@ -54,6 +54,8 @@ public: auto blockTypeBelow = a_ChunkInterface.GetBlock(a_BlockPos.addedY(-1)); if (cBlockInfo::FullyOccupiesVoxel(blockTypeBelow) || IsBlockLiquid(blockTypeBelow)) { + // Setting air with FastSetBlock prevents SetBlock recursively calling OnBroken. + a_ChunkInterface.FastSetBlock(a_BlockPos, E_BLOCK_AIR, 0); a_ChunkInterface.SetBlock(a_BlockPos, E_BLOCK_WATER, 0); } } -- cgit v1.2.3