From 07619d932d703611c2e3e1296871bee5e27876b7 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 16 Jan 2018 19:13:17 +0000 Subject: Exp Orbs and Pickups are destroyed instantly by cacti. (#4136) * Cactus detection code follows pattern set in #3996 * Pickups are now destroyed on cactus contact * Add cactus detection and destruction to Exp Orbs Remove checks for IsExpOrb() in cEntity::Tick() Exp Orbs do not call super::Tick() and so this condition was pointless. --- src/Entities/Pickup.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/Entities/Pickup.cpp') diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp index be6f3ebe3..629f5d189 100644 --- a/src/Entities/Pickup.cpp +++ b/src/Entities/Pickup.cpp @@ -195,6 +195,21 @@ void cPickup::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) +bool cPickup::DoTakeDamage(TakeDamageInfo & a_TDI) +{ + if (a_TDI.DamageType == dtCactusContact) + { + Destroy(true); + return true; + } + + return super::DoTakeDamage(a_TDI); +} + + + + + bool cPickup::CollectedBy(cPlayer & a_Dest) { if (m_bCollected) -- cgit v1.2.3