Don't push blocks outside world height limits (#4516)
* Don't push blocks outside world height limits * Style fix * Apply suggestion Co-Authored-By: peterbell10 <peterbell10@live.co.uk> * Apply suggestion Co-Authored-By: peterbell10 <peterbell10@live.co.uk> * Improvements * Add block type check back * Revert line break changes * Update BlockPiston.cpp Co-authored-by: peterbell10 <peterbell10@live.co.uk>
This commit is contained in:
parent
9ddf433ae7
commit
41e09484b7
@ -142,6 +142,11 @@ bool cBlockPistonHandler::CanPushBlock(
|
||||
NIBBLETYPE currMeta;
|
||||
a_World.GetBlockTypeMeta(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, currBlock, currMeta);
|
||||
|
||||
if (!cChunkDef::IsValidHeight(a_BlockPos.y))
|
||||
{
|
||||
return !a_RequirePushable;
|
||||
}
|
||||
|
||||
if (currBlock == E_BLOCK_AIR)
|
||||
{
|
||||
// Air can be pushed
|
||||
|
Loading…
Reference in New Issue
Block a user