diff options
author | madmaxoft <github@xoft.cz> | 2014-08-12 11:10:32 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-08-12 11:10:32 +0200 |
commit | 3020e8cc05a0732ee880ab16bbab66e4e9b72dd7 (patch) | |
tree | b373615f2008cee45301ac1756d18396c161ae05 /src/BlockEntities/HopperEntity.cpp | |
parent | Fixed unchecked return values. (diff) | |
parent | Merge pull request #1316 from ChriPiv/master (diff) | |
download | cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.gz cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.bz2 cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.lz cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.xz cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.tar.zst cuberite-3020e8cc05a0732ee880ab16bbab66e4e9b72dd7.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockEntities/HopperEntity.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/BlockEntities/HopperEntity.cpp b/src/BlockEntities/HopperEntity.cpp index 48d3b8dcc..88e7b8e1b 100644 --- a/src/BlockEntities/HopperEntity.cpp +++ b/src/BlockEntities/HopperEntity.cpp @@ -549,13 +549,13 @@ bool cHopperEntity::MoveItemsFromSlot(cBlockEntityWithItems & a_Entity, int a_Sl bool cHopperEntity::MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ) { // Try the chest directly connected to the hopper: - cChestEntity * Chest = (cChestEntity *)a_Chunk.GetBlockEntity(a_BlockX, a_BlockY, a_BlockZ); - if (Chest == NULL) + cChestEntity * ConnectedChest = (cChestEntity *)a_Chunk.GetBlockEntity(a_BlockX, a_BlockY, a_BlockZ); + if (ConnectedChest == NULL) { LOGWARNING("%s: A chest entity was not found where expected, at {%d, %d, %d}", __FUNCTION__, a_BlockX, a_BlockY, a_BlockZ); return false; } - if (MoveItemsToGrid(*Chest)) + if (MoveItemsToGrid(*ConnectedChest)) { // Chest block directly connected was not full return true; @@ -586,13 +586,13 @@ bool cHopperEntity::MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_Block } BLOCKTYPE Block = Neighbor->GetBlock(x, a_BlockY, z); - if (Block != Chest->GetBlockType()) + if (Block != ConnectedChest->GetBlockType()) { // Not the same kind of chest continue; } - Chest = (cChestEntity *)Neighbor->GetBlockEntity(a_BlockX + Coords[i].x, a_BlockY, a_BlockZ + Coords[i].z); + cChestEntity * Chest = (cChestEntity *)Neighbor->GetBlockEntity(a_BlockX + Coords[i].x, a_BlockY, a_BlockZ + Coords[i].z); if (Chest == NULL) { LOGWARNING("%s: A chest entity was not found where expected, at {%d, %d, %d} (%d, %d)", __FUNCTION__, a_BlockX + Coords[i].x, a_BlockY, a_BlockZ + Coords[i].z, x, z); |