diff options
author | Persson-dev <66266021+Persson-dev@users.noreply.github.com> | 2021-12-29 20:28:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-29 20:28:41 +0100 |
commit | fec64bb91c03c5e872a8f6fbc1a253f341373072 (patch) | |
tree | 74eca1320f61b93cae672a0d9def7abea2ab80ef /src/Entities/Pawn.cpp | |
parent | Update solid and transparent blocks (#5353) (diff) | |
download | cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.gz cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.bz2 cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.lz cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.xz cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.tar.zst cuberite-fec64bb91c03c5e872a8f6fbc1a253f341373072.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Pawn.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp index a1c3a7610..e227dca6f 100644 --- a/src/Entities/Pawn.cpp +++ b/src/Entities/Pawn.cpp @@ -102,6 +102,23 @@ void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) return; } HandleFalling(); + + // Handle item pickup + if (m_Health > 0) + { + if (IsPlayer()) + { + m_World->CollectPickupsByEntity(*this); + } + else if (IsMob()) + { + cMonster & Mob = static_cast<cMonster &>(*this); + if (Mob.CanPickUpLoot()) + { + m_World->CollectPickupsByEntity(*this); + } + } + } } |