From 24dc221b508a6a44f1003aa938eb2c1ce5561cd6 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 8 Jun 2001 14:05:48 +0000 Subject: [PATCH] --- source/pickups/pickup.cpp | 2 +- source/pickups/pkelp.cpp | 22 ++++++++++++++++++++++ source/pickups/pkelp.h | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/source/pickups/pickup.cpp b/source/pickups/pickup.cpp index 3cb8d9684..44e6e8a97 100644 --- a/source/pickups/pickup.cpp +++ b/source/pickups/pickup.cpp @@ -183,13 +183,13 @@ void CBasePickup::collidedWith(CThing *_thisThing) switch(_thisThing->getThingType()) { case TYPE_PLAYER: - case TYPE_NPC: collect((CPlayer*)_thisThing); CSoundMediator::playSfx(sfxToPlayWhenCollected()); break; default: ASSERT(0); + case TYPE_NPC: break; } } diff --git a/source/pickups/pkelp.cpp b/source/pickups/pkelp.cpp index 3ece84ff5..97f77352a 100644 --- a/source/pickups/pkelp.cpp +++ b/source/pickups/pkelp.cpp @@ -130,6 +130,28 @@ void CKelpTokenPickup::renderPickup(DVECTOR *_pos) sprites->printFT4(fh,x,y,0,0,OTPOS__PICKUP_POS); } +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CKelpTokenPickup::collidedWith(CThing *_thisThing) +{ + switch(_thisThing->getThingType()) + { + case TYPE_PLAYER: + case TYPE_NPC: + collect((CPlayer*)_thisThing); + CSoundMediator::playSfx(sfxToPlayWhenCollected()); + break; + + default: + ASSERT(0); + break; + } +} + /*=========================================================================== end */ diff --git a/source/pickups/pkelp.h b/source/pickups/pkelp.h index ed53719e9..ac906f843 100644 --- a/source/pickups/pkelp.h +++ b/source/pickups/pkelp.h @@ -45,6 +45,7 @@ public: void setTokenNumber(int _number) {m_tokenNumber=_number;} protected: + virtual void collidedWith(CThing *_thisThing); virtual void renderPickup(DVECTOR *_pos); private: