diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-03-28 15:41:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-28 15:41:34 +0200 |
commit | 125df19477055a8e33b25aaafa05f5c59fd32626 (patch) | |
tree | 61cc24dd104d2c777dcfd0805ba685b0d540ec68 /src/Chunk.cpp | |
parent | Unify DoWithBlockEntity (#5168) (diff) | |
download | cuberite-125df19477055a8e33b25aaafa05f5c59fd32626.tar cuberite-125df19477055a8e33b25aaafa05f5c59fd32626.tar.gz cuberite-125df19477055a8e33b25aaafa05f5c59fd32626.tar.bz2 cuberite-125df19477055a8e33b25aaafa05f5c59fd32626.tar.lz cuberite-125df19477055a8e33b25aaafa05f5c59fd32626.tar.xz cuberite-125df19477055a8e33b25aaafa05f5c59fd32626.tar.zst cuberite-125df19477055a8e33b25aaafa05f5c59fd32626.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Chunk.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 09b0f0f99..4aa28d257 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -960,10 +960,9 @@ cItems cChunk::PickupsFromBlock(Vector3i a_RelPos, const cEntity * a_Digger, con cItems Pickups; const auto BlockEntity = GetBlockEntityRel(a_RelPos); - const auto ToolHandler = (a_Tool != nullptr) ? a_Tool->GetHandler() : cItemHandler::GetItemHandler(E_ITEM_EMPTY); - if (ToolHandler->CanHarvestBlock(BlockType)) + if ((a_Tool == nullptr) || a_Tool->GetHandler()->CanHarvestBlock(BlockType)) { - Pickups = cBlockHandler::For(BlockType).ConvertToPickups(BlockMeta, a_Digger, a_Tool); + Pickups = cBlockHandler::For(BlockType).ConvertToPickups(BlockMeta, a_Tool); if (BlockEntity != nullptr) { |