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
This commit is contained in:
Alexander Harkness
2020-04-03 20:24:49 +00:00
committed by GitHub
parent 4c6f95f49a
commit ba048e2101
4 changed files with 15 additions and 17 deletions
+2
View File
@@ -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);
}
}