From d9f745fd8b6e5b8bb320391c4f1edc0e8162a02f Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 13 Jul 2001 20:17:16 +0000 Subject: [PATCH] --- source/triggers/tgstop.cpp | 30 ++++++++++++++++++++++++++++++ source/triggers/tgstop.h | 6 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/source/triggers/tgstop.cpp b/source/triggers/tgstop.cpp index 2667d43d7..739cac2f8 100644 --- a/source/triggers/tgstop.cpp +++ b/source/triggers/tgstop.cpp @@ -30,6 +30,10 @@ #include "friend\fgary.h" #endif +#ifndef __PICKUPS_PICKUP_H__ +#include "pickups\pickup.h" +#endif + /* Std Lib ------- */ @@ -54,6 +58,19 @@ ---- */ +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CGaryStopTrigger::init() +{ + CTrigger::init(); + + m_dropped = false; +} + /*---------------------------------------------------------------------- Function: Purpose: @@ -71,6 +88,19 @@ void CGaryStopTrigger::collidedWith(CThing *_thisThing) CNpcGaryFriend *gary = (CNpcGaryFriend *) _thisThing; gary->stop(); + + if ( !m_dropped ) + { + if ( GameScene.getChapterNumber() != 6 ) + { + DVECTOR newPos = Pos; + newPos.vy -= 8; + + createPickup(PICKUP__LIFE,&newPos); + } + + m_dropped = true; + } } break; diff --git a/source/triggers/tgstop.h b/source/triggers/tgstop.h index c6930869b..90c89343b 100644 --- a/source/triggers/tgstop.h +++ b/source/triggers/tgstop.h @@ -36,8 +36,12 @@ class CGaryStopTrigger : public CTrigger { +public: + void init(); protected: - virtual void collidedWith(CThing *_thisThing); + void collidedWith(CThing *_thisThing); + + u8 m_dropped; }; /*----------------------------------------------------------------------