summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pickup.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2018-01-14 19:44:45 +0100
committerpeterbell10 <peterbell10@live.co.uk>2018-01-14 19:44:45 +0100
commitad22922393c7982b885840960222de64ff96ad36 (patch)
treea028b7459f3c865f7e8bd563ae476c578763a9b1 /src/Entities/Pickup.cpp
parentTravis: Remove gdb (#4140) (diff)
downloadcuberite-ad22922393c7982b885840960222de64ff96ad36.tar
cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.gz
cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.bz2
cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.lz
cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.xz
cuberite-ad22922393c7982b885840960222de64ff96ad36.tar.zst
cuberite-ad22922393c7982b885840960222de64ff96ad36.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Pickup.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index 26fe58252..be6f3ebe3 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -147,17 +147,8 @@ void cPickup::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
// Position might have changed due to physics. So we have to make sure we have the correct chunk.
GET_AND_VERIFY_CURRENT_CHUNK(CurrentChunk, BlockX, BlockZ)
- int RelBlockX = BlockX - (CurrentChunk->GetPosX() * cChunkDef::Width);
- int RelBlockZ = BlockZ - (CurrentChunk->GetPosZ() * cChunkDef::Width);
-
- // If the pickup is on the bottommost block position, make it think the void is made of air: (#131)
- BLOCKTYPE BlockBelow = (BlockY > 0) ? CurrentChunk->GetBlock(RelBlockX, BlockY - 1, RelBlockZ) : E_BLOCK_AIR;
- BLOCKTYPE BlockIn = CurrentChunk->GetBlock(RelBlockX, BlockY, RelBlockZ);
-
- if (
- IsBlockLava(BlockBelow) || (BlockBelow == E_BLOCK_FIRE) ||
- IsBlockLava(BlockIn) || (BlockIn == E_BLOCK_FIRE)
- )
+ // Destroy the pickup if it is on fire:
+ if (IsOnFire())
{
m_bCollected = true;
m_Timer = std::chrono::milliseconds(0); // We have to reset the timer.
@@ -261,7 +252,3 @@ bool cPickup::CollectedBy(cPlayer & a_Dest)
// LOG("Pickup %d cannot be collected by \"%s\", because there's no space in the inventory.", a_Dest->GetName().c_str(), m_UniqueID);
return false;
}
-
-
-
-