From 573321782af54f8dbf7bb4e354900804ce1405f4 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 20 Jun 2001 18:52:02 +0000 Subject: [PATCH] --- source/hazard/hrweight.h | 1 + source/hazard/hrwheel.h | 1 + source/platform/pbaloon.h | 1 + source/platform/pdual.cpp | 17 ++++++++++------- source/platform/prbridge.h | 1 + source/platform/psbarrel.h | 1 + source/platform/pseesaw.h | 1 + source/platform/ptrpdoor.h | 1 + 8 files changed, 17 insertions(+), 7 deletions(-) diff --git a/source/hazard/hrweight.h b/source/hazard/hrweight.h index ce9444950..bc63e6f6a 100644 --- a/source/hazard/hrweight.h +++ b/source/hazard/hrweight.h @@ -25,6 +25,7 @@ public: virtual void render(); DVECTOR const &getWheelPos() {return( m_wheelPos );} void setTriggered() {m_triggered = true;} + virtual CRECT const *getThinkBBox() {return( &getCollisionArea() );} protected: virtual void setWaypoints( sThingHazard *ThisHazard ); virtual void processMovement( int _frames ); diff --git a/source/hazard/hrwheel.h b/source/hazard/hrwheel.h index 64f2b4a97..f5cf51c3e 100644 --- a/source/hazard/hrwheel.h +++ b/source/hazard/hrwheel.h @@ -29,6 +29,7 @@ public: DVECTOR const &getWheelPos() {return( m_wheelPos );} void linkToWeight( CNpcRisingWeightHazard *weight ) {m_weight = weight;} virtual void render(); + virtual CRECT const *getThinkBBox() {return( &getCollisionArea() );} protected: virtual void setWaypoints( sThingHazard *ThisHazard ); virtual void collidedWith(CThing *_thisThing); diff --git a/source/platform/pbaloon.h b/source/platform/pbaloon.h index a8411f556..ac7f399e0 100644 --- a/source/platform/pbaloon.h +++ b/source/platform/pbaloon.h @@ -36,6 +36,7 @@ public: virtual void postInit(); virtual void render(); virtual void shutdown(); + virtual CRECT const *getThinkBBox() {return( &getCollisionArea() );} protected: virtual void setWaypoints( sThingPlatform *ThisPlatform ); virtual void processMovement( int _frames ); diff --git a/source/platform/pdual.cpp b/source/platform/pdual.cpp index bb7989625..08f3e1be1 100644 --- a/source/platform/pdual.cpp +++ b/source/platform/pdual.cpp @@ -128,15 +128,18 @@ void CNpcDualPlatform::setWaypoints( sThingPlatform *ThisPlatform ) m_otherPlatform->setLineBase( slavePos ); } - s32 minX, maxX, minY, maxY; + m_thinkArea.x1 = startPos.vx; + m_thinkArea.x2 = slavePos.vx; - m_npcPath.getPathXExtents( &minX, &maxX ); - m_npcPath.getPathYExtents( &minY, &maxY ); + if ( m_thinkArea.x1 > m_thinkArea.x2 ) + { + int temp = m_thinkArea.x2; + m_thinkArea.x2 = m_thinkArea.x1; + m_thinkArea.x1 = temp; + } - m_thinkArea.x1 = minX; - m_thinkArea.x2 = maxX; - m_thinkArea.y1 = minY; - m_thinkArea.y2 = maxY; + m_thinkArea.y1 = startPos.vy; + m_thinkArea.y2 = startPos.vy + m_maxExtension; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/prbridge.h b/source/platform/prbridge.h index 980e6df2d..0c249f888 100644 --- a/source/platform/prbridge.h +++ b/source/platform/prbridge.h @@ -23,6 +23,7 @@ class CNpcRisingBridgePlatform : public CNpcPlatform public: virtual void postInit(); virtual void trigger(); + virtual CRECT const *getThinkBBox() {return( &getCollisionArea() );} protected: virtual void setWaypoints( sThingPlatform *ThisPlatform ); virtual void processMovement( int _frames ); diff --git a/source/platform/psbarrel.h b/source/platform/psbarrel.h index cb51f799b..98c13567a 100644 --- a/source/platform/psbarrel.h +++ b/source/platform/psbarrel.h @@ -23,6 +23,7 @@ class CNpcSteerableBarrelPlatform : public CNpcPlatform public: virtual void render(); virtual void postInit(); + virtual CRECT const *getThinkBBox() {return( &getCollisionArea() );} protected: virtual void processMovement( int _frames ); virtual void collidedWith(CThing *_thisThing); diff --git a/source/platform/pseesaw.h b/source/platform/pseesaw.h index 62cf57ba1..30a4c4b52 100644 --- a/source/platform/pseesaw.h +++ b/source/platform/pseesaw.h @@ -23,6 +23,7 @@ class CNpcSeesawPlatform : public CNpcPlatform public: virtual void postInit(); virtual void render(); + virtual CRECT const *getThinkBBox() {return( &getCollisionArea() );} protected: virtual void processMovement( int _frames ); diff --git a/source/platform/ptrpdoor.h b/source/platform/ptrpdoor.h index 5d0239c48..375eba212 100644 --- a/source/platform/ptrpdoor.h +++ b/source/platform/ptrpdoor.h @@ -25,6 +25,7 @@ public: DVECTOR const &getTriggerPos() {return( m_triggerPos );} void setTriggered() {m_triggered = true;} virtual void render(); + virtual CRECT const *getThinkBBox() {return( &getCollisionArea() );} protected: virtual void setWaypoints( sThingPlatform *ThisPlatform ); virtual void processMovement( int _frames );