1
0

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:
Mat 2020-03-22 22:51:11 +02:00 committed by GitHub
parent 9ddf433ae7
commit 41e09484b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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