diff options
author | DrButcher <JoBad@online.de> | 2020-05-03 22:05:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-03 22:05:32 +0200 |
commit | 258318ab98771f03d0109d7dfba81daaed26a2a0 (patch) | |
tree | 87f4d9cc16e0a18711afdd4070bdf3874bc358df /src/Entities/ArrowEntity.cpp | |
parent | Add cEntity::GetBoundingBox, and use where appropriate. (#4711) (diff) | |
download | cuberite-258318ab98771f03d0109d7dfba81daaed26a2a0.tar cuberite-258318ab98771f03d0109d7dfba81daaed26a2a0.tar.gz cuberite-258318ab98771f03d0109d7dfba81daaed26a2a0.tar.bz2 cuberite-258318ab98771f03d0109d7dfba81daaed26a2a0.tar.lz cuberite-258318ab98771f03d0109d7dfba81daaed26a2a0.tar.xz cuberite-258318ab98771f03d0109d7dfba81daaed26a2a0.tar.zst cuberite-258318ab98771f03d0109d7dfba81daaed26a2a0.zip |
Diffstat (limited to 'src/Entities/ArrowEntity.cpp')
-rw-r--r-- | src/Entities/ArrowEntity.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp index 17c915742..ebb8524f1 100644 --- a/src/Entities/ArrowEntity.cpp +++ b/src/Entities/ArrowEntity.cpp @@ -3,6 +3,7 @@ #include "Player.h" #include "ArrowEntity.h" #include "../Chunk.h" +#include "../Blocks/BlockButton.h" @@ -84,6 +85,10 @@ void cArrowEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) // Broadcast arrow hit sound m_World->BroadcastSoundEffect("entity.arrow.hit", m_HitBlockPos, 0.5f, static_cast<float>(0.75 + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64)); + // Trigger any buttons that were hit + // Wooden buttons will be depressed by the arrow + cBlockButtonHandler::OnArrowHit(*m_World, m_HitBlockPos, a_HitFace); + if ((m_World->GetBlock(m_HitBlockPos) == E_BLOCK_TNT) && IsOnFire()) { m_World->SetBlock(m_HitBlockPos, E_BLOCK_AIR, 0); |