summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pawn.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Entities/Pawn.cpp17
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);
+ }
+ }
+ }
}