summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-28 15:41:34 +0200
committerGitHub <noreply@github.com>2021-03-28 15:41:34 +0200
commit125df19477055a8e33b25aaafa05f5c59fd32626 (patch)
tree61cc24dd104d2c777dcfd0805ba685b0d540ec68 /src/Chunk.cpp
parentUnify DoWithBlockEntity (#5168) (diff)
downloadcuberite-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 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp5
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)
{