1
0

Fixed crash in hopper while pulling items from blockentity above itself (#4412)

This commit is contained in:
NiLSPACE 2019-10-04 15:50:47 +02:00 committed by GitHub
parent 7b603f3c95
commit 241d97bbf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,7 +148,7 @@ bool cHopperEntity::MoveItemsIn(cChunk & a_Chunk, Int64 a_CurrentTick)
// Try moving an item in: // Try moving an item in:
bool res = false; bool res = false;
switch (a_Chunk.GetBlock(GetRelPos())) switch (a_Chunk.GetBlock(GetRelPos().addedY(1)))
{ {
case E_BLOCK_TRAPPED_CHEST: case E_BLOCK_TRAPPED_CHEST:
case E_BLOCK_CHEST: case E_BLOCK_CHEST:
@ -168,7 +168,7 @@ bool cHopperEntity::MoveItemsIn(cChunk & a_Chunk, Int64 a_CurrentTick)
case E_BLOCK_DROPPER: case E_BLOCK_DROPPER:
case E_BLOCK_HOPPER: case E_BLOCK_HOPPER:
{ {
res = MoveItemsFromGrid(*static_cast<cBlockEntityWithItems *>(a_Chunk.GetBlockEntity(GetRelPos().addedY(1)))); res = MoveItemsFromGrid(*static_cast<cBlockEntityWithItems *>(a_Chunk.GetBlockEntity(this->GetPos().addedY(1))));
break; break;
} }
} }