From adee4b97be38d976feeef521d73fff41eb389e99 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 19 Jun 2001 20:07:57 +0000 Subject: [PATCH] --- source/enemy/nclam.cpp | 10 ++++++++++ source/enemy/nmjfish.cpp | 10 ++++++++++ source/enemy/npc.cpp | 10 ++++++++++ source/enemy/npc.h | 2 ++ source/enemy/nsjfish.h | 1 + source/enemy/nssnake.cpp | 4 ++-- source/enemy/nssnake.h | 2 +- source/enemy/nsstomp.cpp | 4 ++-- source/enemy/nsstomp.h | 2 +- source/hazard/hazard.cpp | 10 ++++++++++ source/hazard/hazard.h | 2 ++ source/hazard/hbarrel.cpp | 4 ++-- source/hazard/hbarrel.h | 2 +- source/hazard/hbbarrel.cpp | 4 ++-- source/hazard/hbbarrel.h | 2 +- source/hazard/hbrock.cpp | 10 ++++++++++ source/hazard/hbwheel.cpp | 4 ++-- source/hazard/hbwheel.h | 2 +- source/hazard/hcswitch.cpp | 10 ++++++++++ source/hazard/hdbarrel.cpp | 4 ++-- source/hazard/hdbarrel.h | 2 +- source/hazard/hfalling.cpp | 10 ++++++++++ source/hazard/hfirebal.cpp | 5 +++++ source/hazard/hlog.cpp | 9 +++++++++ source/hazard/hpendulm.cpp | 5 ++++- source/hazard/hpswitch.cpp | 10 ++++++++++ source/hazard/hrrock.cpp | 4 ++-- source/hazard/hrrock.h | 2 +- source/hazard/hrweight.cpp | 10 ++++++++++ source/hazard/hrwheel.cpp | 10 ++++++++++ source/hazard/hspikes.cpp | 4 ++-- source/hazard/hspikes.h | 2 +- source/hazard/hsrdfish.cpp | 5 +++++ source/platform/pbaloon.cpp | 10 ++++++++++ source/platform/pbgeyser.cpp | 4 ++-- source/platform/pbgeyser.h | 2 +- source/platform/pbranch.cpp | 10 ++++++++++ source/platform/pbubble.cpp | 14 ++++++++++++-- source/platform/pbubble.h | 2 +- source/platform/pbubtube.cpp | 10 ++++++++++ source/platform/pbwheel.cpp | 9 +++++++-- source/platform/pbwheel.h | 2 +- source/platform/pconveyr.cpp | 8 ++++---- source/platform/pconveyr.h | 4 ++-- source/platform/pdrop.cpp | 4 ++-- source/platform/pdrop.h | 4 ++-- source/platform/pdual.cpp | 14 ++++++++++++-- source/platform/pdual.h | 2 +- source/platform/pjellfsh.cpp | 4 ++-- source/platform/pjellfsh.h | 2 +- source/platform/plantern.cpp | 14 ++++++++++++-- source/platform/plantern.h | 2 +- source/platform/platform.cpp | 10 ++++++++++ source/platform/platform.h | 2 ++ source/platform/plift.cpp | 10 ++++++++++ source/platform/plinear.cpp | 4 ++-- source/platform/plinear.h | 2 +- source/platform/ppendulm.cpp | 11 +++++++++-- source/platform/ppendulm.h | 2 +- source/platform/praft.cpp | 4 ++-- source/platform/praft.h | 2 +- source/platform/prbridge.cpp | 10 ++++++++++ source/platform/psswitch.cpp | 10 ++++++++++ source/platform/ptrpdoor.cpp | 10 ++++++++++ 64 files changed, 313 insertions(+), 62 deletions(-) diff --git a/source/enemy/nclam.cpp b/source/enemy/nclam.cpp index 5db5bf179..a23645596 100644 --- a/source/enemy/nclam.cpp +++ b/source/enemy/nclam.cpp @@ -133,6 +133,16 @@ void CNpcJumpingClamEnemy::setupWaypoints( sThingActor *ThisActor ) m_maxExtension = isqrt2( ( xDist * xDist ) + ( yDist * yDist ) ); } + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/nmjfish.cpp b/source/enemy/nmjfish.cpp index 2370e7174..148b38294 100644 --- a/source/enemy/nmjfish.cpp +++ b/source/enemy/nmjfish.cpp @@ -137,6 +137,16 @@ void CNpcMotherJellyfishEnemy::setupWaypoints( sThingActor *ThisActor ) } } } + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 8251ae9e8..2eefb0126 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -519,6 +519,16 @@ void CNpcEnemy::setupWaypoints( sThingActor *ThisActor ) setHeading( newXPos, newYPos ); } + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/npc.h b/source/enemy/npc.h index f805afdc6..0b5640e8e 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -125,6 +125,7 @@ public: virtual void setupWaypoints( sThingActor *ThisActor ); virtual int canCollide(); + virtual CRECT const *getThinkBBox() {return &m_thinkArea;} bool canBeSuckedUp(); bool suckUp( DVECTOR *suckPos, int _frames ); @@ -313,6 +314,7 @@ protected: u8 m_isDying; u32 m_RGB; int m_soundId; + CRECT m_thinkArea; s32 m_frame; int m_animNo; diff --git a/source/enemy/nsjfish.h b/source/enemy/nsjfish.h index b35c2cf45..6a0739e42 100644 --- a/source/enemy/nsjfish.h +++ b/source/enemy/nsjfish.h @@ -29,6 +29,7 @@ public: virtual void render(); virtual int getFrameCount() {return( FRM_JELLYFISH1_SWIM7 - FRM_JELLYFISH1_SWIM1 + 1 );} virtual u8 canCollideWithEnemy() {return( false );} + virtual CRECT const *getThinkBBox() {return( &getCollisionArea() );} protected: virtual bool processSensor(); virtual void processClose( int _frames ); diff --git a/source/enemy/nssnake.cpp b/source/enemy/nssnake.cpp index 84205366f..43ca12aba 100644 --- a/source/enemy/nssnake.cpp +++ b/source/enemy/nssnake.cpp @@ -721,7 +721,7 @@ void CNpcSeaSnakeEnemy::processShot( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcSeaSnakeEnemy::getThinkBBox() +/*const CRECT *CNpcSeaSnakeEnemy::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -732,7 +732,7 @@ const CRECT *CNpcSeaSnakeEnemy::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} +}*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/nssnake.h b/source/enemy/nssnake.h index 649b3655c..93c1a88d4 100644 --- a/source/enemy/nssnake.h +++ b/source/enemy/nssnake.h @@ -53,7 +53,7 @@ public: virtual void shutdown(); virtual void render(); virtual int checkCollisionAgainst(CThing *_thisThing, int _frames); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual bool processSensor(); virtual void processClose( int _frames ); diff --git a/source/enemy/nsstomp.cpp b/source/enemy/nsstomp.cpp index c6519d093..a5e965756 100644 --- a/source/enemy/nsstomp.cpp +++ b/source/enemy/nsstomp.cpp @@ -158,7 +158,7 @@ void CNpcSkullStomperEnemy::processClose( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcSkullStomperEnemy::getThinkBBox() +/*const CRECT *CNpcSkullStomperEnemy::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -169,7 +169,7 @@ const CRECT *CNpcSkullStomperEnemy::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} +}*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/nsstomp.h b/source/enemy/nsstomp.h index de93a9650..ff9dbe73b 100644 --- a/source/enemy/nsstomp.h +++ b/source/enemy/nsstomp.h @@ -18,7 +18,7 @@ class CNpcSkullStomperEnemy : public CNpcEnemy { public: virtual void postInit(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void processEnemyCollision( CThing *thisThing ); virtual bool processSensor(); diff --git a/source/hazard/hazard.cpp b/source/hazard/hazard.cpp index 570c39ea1..b99209270 100644 --- a/source/hazard/hazard.cpp +++ b/source/hazard/hazard.cpp @@ -375,6 +375,16 @@ void CNpcHazard::setWaypoints( sThingHazard *ThisHazard ) Pos = startPos; m_base = Pos; + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hazard.h b/source/hazard/hazard.h index 0bb4917b2..eecfbc92b 100644 --- a/source/hazard/hazard.h +++ b/source/hazard/hazard.h @@ -83,6 +83,7 @@ public: virtual void setRespawnRate( s16 newRespawnRate ) {m_respawnRate=newRespawnRate;} virtual void trigger() {} virtual void leftThinkZone(int _frames); + virtual CRECT const *getThinkBBox() {return &m_thinkArea;} static NPC_HAZARD_UNIT_TYPE getTypeFromMapEdit( u16 newType ); static CNpcHazard *Create(int Type); @@ -118,6 +119,7 @@ protected: CModelGfx *m_modelGfx; s16 m_respawnRate; int m_soundId; + CRECT m_thinkArea; CThing *m_platform; diff --git a/source/hazard/hbarrel.cpp b/source/hazard/hbarrel.cpp index 4a1daa40a..eb089b8bf 100644 --- a/source/hazard/hbarrel.cpp +++ b/source/hazard/hbarrel.cpp @@ -155,7 +155,7 @@ void CNpcBarrelHazard::render() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcBarrelHazard::getThinkBBox() +/*const CRECT *CNpcBarrelHazard::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -166,4 +166,4 @@ const CRECT *CNpcBarrelHazard::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/hazard/hbarrel.h b/source/hazard/hbarrel.h index 1fad3c383..ecbc2f3d1 100644 --- a/source/hazard/hbarrel.h +++ b/source/hazard/hbarrel.h @@ -23,7 +23,7 @@ class CNpcBarrelHazard : public CNpcHazard public: void init(); void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: void processMovement( int _frames ); diff --git a/source/hazard/hbbarrel.cpp b/source/hazard/hbbarrel.cpp index eee64e7fe..29b49c0cc 100644 --- a/source/hazard/hbbarrel.cpp +++ b/source/hazard/hbbarrel.cpp @@ -198,7 +198,7 @@ void CNpcBouncingBarrelHazard::render() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcBouncingBarrelHazard::getThinkBBox() +/*const CRECT *CNpcBouncingBarrelHazard::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -209,7 +209,7 @@ const CRECT *CNpcBouncingBarrelHazard::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} +}*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hbbarrel.h b/source/hazard/hbbarrel.h index 3b4ab4ed9..f92e8fd5e 100644 --- a/source/hazard/hbbarrel.h +++ b/source/hazard/hbbarrel.h @@ -23,7 +23,7 @@ class CNpcBouncingBarrelHazard : public CNpcHazard public: void init(); void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: void processMovement( int _frames ); virtual void collidedWith(CThing *_thisThing); diff --git a/source/hazard/hbrock.cpp b/source/hazard/hbrock.cpp index e3d4598b5..5562b0adb 100644 --- a/source/hazard/hbrock.cpp +++ b/source/hazard/hbrock.cpp @@ -77,6 +77,16 @@ void CNpcBouncingRockHazard::setWaypoints( sThingHazard *ThisHazard ) trigger=(CHazardTrigger*)CTrigger::Create(CTrigger::TRIGGER_HAZARD_WALK); trigger->setPositionAndSize( ( newXPos << 4 ) + 8, ( newYPos << 4 ) + 16, 100, 0 ); trigger->setHazard( this ); + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hbwheel.cpp b/source/hazard/hbwheel.cpp index 3158fdc9f..5241279fa 100644 --- a/source/hazard/hbwheel.cpp +++ b/source/hazard/hbwheel.cpp @@ -79,7 +79,7 @@ void CNpcBigWheelHazard::collidedWith( CThing *_thisThing ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcBigWheelHazard::getThinkBBox() +/*const CRECT *CNpcBigWheelHazard::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -90,4 +90,4 @@ const CRECT *CNpcBigWheelHazard::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/hazard/hbwheel.h b/source/hazard/hbwheel.h index bb6944704..410287d17 100644 --- a/source/hazard/hbwheel.h +++ b/source/hazard/hbwheel.h @@ -23,7 +23,7 @@ class CNpcBigWheelHazard : public CNpcHazard public: void init(); virtual void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: void processMovement( int _frames ); virtual void collidedWith(CThing *_thisThing); diff --git a/source/hazard/hcswitch.cpp b/source/hazard/hcswitch.cpp index 31c76d0ad..714dab93b 100644 --- a/source/hazard/hcswitch.cpp +++ b/source/hazard/hcswitch.cpp @@ -105,6 +105,16 @@ void CNpcConveyorSwitchHazard::setWaypoints( sThingHazard *ThisHazard ) PntList++; m_conveyorPos.vx = ( newXPos << 4 ) + 8; m_conveyorPos.vy = ( newYPos << 4 ) + 8; + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hdbarrel.cpp b/source/hazard/hdbarrel.cpp index 8efad256c..4fffa817e 100644 --- a/source/hazard/hdbarrel.cpp +++ b/source/hazard/hdbarrel.cpp @@ -181,7 +181,7 @@ void CNpcDualPlatformBarrelHazard::render() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcDualPlatformBarrelHazard::getThinkBBox() +/*const CRECT *CNpcDualPlatformBarrelHazard::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -192,4 +192,4 @@ const CRECT *CNpcDualPlatformBarrelHazard::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/hazard/hdbarrel.h b/source/hazard/hdbarrel.h index d4a8e9268..6f50cc67f 100644 --- a/source/hazard/hdbarrel.h +++ b/source/hazard/hdbarrel.h @@ -23,7 +23,7 @@ class CNpcDualPlatformBarrelHazard : public CNpcHazard public: void init(); void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: void processMovement( int _frames ); diff --git a/source/hazard/hfalling.cpp b/source/hazard/hfalling.cpp index 149ec05e0..8db555161 100644 --- a/source/hazard/hfalling.cpp +++ b/source/hazard/hfalling.cpp @@ -259,6 +259,16 @@ void CNpcFallingHazard::setWaypoints( sThingHazard *ThisHazard ) Pos = startPos; m_base = Pos; + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hfirebal.cpp b/source/hazard/hfirebal.cpp index 8e60e31ea..b9613f5e8 100644 --- a/source/hazard/hfirebal.cpp +++ b/source/hazard/hfirebal.cpp @@ -78,6 +78,11 @@ void CNpcFireballHazard::setWaypoints( sThingHazard *ThisHazard ) m_width = -m_width; } } + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hlog.cpp b/source/hazard/hlog.cpp index e8103ec34..00c925864 100644 --- a/source/hazard/hlog.cpp +++ b/source/hazard/hlog.cpp @@ -63,6 +63,15 @@ void CNpcLogHazard::setWaypoints( sThingHazard *ThisHazard ) Pos = startPos; Pos.vy = minY; m_base = Pos; + + s32 minX, maxX; + + m_npcPath.getPathXExtents( &minX, &maxX ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hpendulm.cpp b/source/hazard/hpendulm.cpp index 81851cc61..49727f318 100644 --- a/source/hazard/hpendulm.cpp +++ b/source/hazard/hpendulm.cpp @@ -84,7 +84,10 @@ void CNpcPendulumHazard::setWaypoints( sThingHazard *ThisHazard ) Pos = startPos; } - m_base = Pos; + m_thinkArea.x1 = Pos.vx - m_length; + m_thinkArea.x2 = Pos.vx + m_length; + m_thinkArea.y1 = Pos.vy - m_length; + m_thinkArea.y2 = Pos.vy + m_length; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hpswitch.cpp b/source/hazard/hpswitch.cpp index 97c84675f..43dbf718d 100644 --- a/source/hazard/hpswitch.cpp +++ b/source/hazard/hpswitch.cpp @@ -57,6 +57,16 @@ void CNpcPressureSwitchHazard::setWaypoints( sThingHazard *ThisHazard ) Pos = startPos; m_base = Pos; + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hrrock.cpp b/source/hazard/hrrock.cpp index 71f692fa6..42b8f4c2f 100644 --- a/source/hazard/hrrock.cpp +++ b/source/hazard/hrrock.cpp @@ -202,7 +202,7 @@ void CNpcRollingRockHazard::render() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcRollingRockHazard::getThinkBBox() +/*const CRECT *CNpcRollingRockHazard::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -213,4 +213,4 @@ const CRECT *CNpcRollingRockHazard::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/hazard/hrrock.h b/source/hazard/hrrock.h index 40af3b3f7..0b0cf4234 100644 --- a/source/hazard/hrrock.h +++ b/source/hazard/hrrock.h @@ -23,7 +23,7 @@ class CNpcRollingRockHazard : public CNpcHazard public: void init(); void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: void processMovement( int _frames ); diff --git a/source/hazard/hrweight.cpp b/source/hazard/hrweight.cpp index 2adc106bc..7c7e8746f 100644 --- a/source/hazard/hrweight.cpp +++ b/source/hazard/hrweight.cpp @@ -95,6 +95,16 @@ void CNpcRisingWeightHazard::setWaypoints( sThingHazard *ThisHazard ) m_pulleyPos.vx = startPos.vx; m_pulleyPos.vy = startPos.vy - ( m_maxExtension >> 8 ); } + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hrwheel.cpp b/source/hazard/hrwheel.cpp index 350d0c3dd..bb7c80dd5 100644 --- a/source/hazard/hrwheel.cpp +++ b/source/hazard/hrwheel.cpp @@ -57,6 +57,16 @@ void CNpcRisingWeightWheelHazard::setWaypoints( sThingHazard *ThisHazard ) m_wheelPos.vx = newXPos; m_wheelPos.vy = newYPos; + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hspikes.cpp b/source/hazard/hspikes.cpp index 651116412..8122c4683 100644 --- a/source/hazard/hspikes.cpp +++ b/source/hazard/hspikes.cpp @@ -95,7 +95,7 @@ void CNpcSpikesHazard::processMovement( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcSpikesHazard::getThinkBBox() +/*const CRECT *CNpcSpikesHazard::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -106,7 +106,7 @@ const CRECT *CNpcSpikesHazard::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} +}*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hspikes.h b/source/hazard/hspikes.h index 10f592999..5c3160d19 100644 --- a/source/hazard/hspikes.h +++ b/source/hazard/hspikes.h @@ -22,7 +22,7 @@ class CNpcSpikesHazard : public CNpcHazard { public: void init(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void processTimer( int _frames ); void processMovement( int _frames ); diff --git a/source/hazard/hsrdfish.cpp b/source/hazard/hsrdfish.cpp index 33c287139..ba3dab09f 100644 --- a/source/hazard/hsrdfish.cpp +++ b/source/hazard/hsrdfish.cpp @@ -93,4 +93,9 @@ void CNpcSwordfishHazard::setWaypoints( sThingHazard *ThisHazard ) m_heading = 2048; } } + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } diff --git a/source/platform/pbaloon.cpp b/source/platform/pbaloon.cpp index 94c354258..2e095dd7b 100644 --- a/source/platform/pbaloon.cpp +++ b/source/platform/pbaloon.cpp @@ -153,6 +153,16 @@ void CNpcBalloonBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform ) PntList++; m_maxExtension = abs( ( ( newYPos << 4 ) + 16 ) - startPos.vy ); + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/pbgeyser.cpp b/source/platform/pbgeyser.cpp index 66613f90b..e374c0874 100644 --- a/source/platform/pbgeyser.cpp +++ b/source/platform/pbgeyser.cpp @@ -92,7 +92,7 @@ void CNpcGeyserPlatformGenerator::think( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcGeyserPlatformGenerator::getThinkBBox() +/*const CRECT *CNpcGeyserPlatformGenerator::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -103,4 +103,4 @@ const CRECT *CNpcGeyserPlatformGenerator::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/platform/pbgeyser.h b/source/platform/pbgeyser.h index 65b84d82f..178551f30 100644 --- a/source/platform/pbgeyser.h +++ b/source/platform/pbgeyser.h @@ -23,7 +23,7 @@ class CNpcGeyserPlatformGenerator : public CNpcPlatform public: void setTargetType( NPC_PLATFORM_UNIT_TYPE targetType ) {m_targetType = targetType;} virtual void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void think( int _frames ); virtual void collidedWith(CThing *_thisThing); diff --git a/source/platform/pbranch.cpp b/source/platform/pbranch.cpp index 55375182a..d11d44280 100644 --- a/source/platform/pbranch.cpp +++ b/source/platform/pbranch.cpp @@ -95,6 +95,16 @@ void CNpcBranchPlatform::setWaypoints( sThingPlatform *ThisPlatform ) { m_reversed = false; } + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/pbubble.cpp b/source/platform/pbubble.cpp index ea25d3146..db2471371 100644 --- a/source/platform/pbubble.cpp +++ b/source/platform/pbubble.cpp @@ -31,6 +31,16 @@ void CNpcBubblePlatform::postInit() CNpcPlatform::postInit(); m_pop = false; + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -109,7 +119,7 @@ void CNpcBubblePlatform::processLifetime( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcBubblePlatform::getThinkBBox() +/*const CRECT *CNpcBubblePlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -120,4 +130,4 @@ const CRECT *CNpcBubblePlatform::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/platform/pbubble.h b/source/platform/pbubble.h index 309bba8d0..e39451f2e 100644 --- a/source/platform/pbubble.h +++ b/source/platform/pbubble.h @@ -23,7 +23,7 @@ class CNpcBubblePlatform : public CNpcPlatform public: virtual void render(); virtual void postInit(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void processLifetime( int _frames ); virtual void processMovement( int _frames ); diff --git a/source/platform/pbubtube.cpp b/source/platform/pbubtube.cpp index 127dafce9..aa8e30f67 100644 --- a/source/platform/pbubtube.cpp +++ b/source/platform/pbubtube.cpp @@ -65,6 +65,16 @@ void CNpcBubbleTubePlatform::setWaypoints( sThingPlatform *ThisPlatform ) PntList++; m_maxExtension = ( ( newYPos << 4 ) + 16 ) - startPos.vy; + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/pbwheel.cpp b/source/platform/pbwheel.cpp index 344f502ac..ce92db96f 100644 --- a/source/platform/pbwheel.cpp +++ b/source/platform/pbwheel.cpp @@ -89,11 +89,16 @@ void CNpcBigWheelPlatform::setWaypoints( sThingPlatform *ThisPlatform ) { init( startPos ); } + + m_thinkArea.x1 = Pos.vx - m_extension; + m_thinkArea.x2 = Pos.vx + m_extension; + m_thinkArea.y1 = Pos.vy - m_extension; + m_thinkArea.y2 = Pos.vy + m_extension; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcBigWheelPlatform::getThinkBBox() +/*const CRECT *CNpcBigWheelPlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -104,7 +109,7 @@ const CRECT *CNpcBigWheelPlatform::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} +}*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/pbwheel.h b/source/platform/pbwheel.h index 00ca69db7..0527689ab 100644 --- a/source/platform/pbwheel.h +++ b/source/platform/pbwheel.h @@ -21,7 +21,7 @@ class CNpcBigWheelPlatform : public CNpcPlatform { public: - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); virtual void postInit(); virtual int getHeightFromPlatformAtPosition(int _x,int _y, int offsetX = 0, int offsetY = 0); protected: diff --git a/source/platform/pconveyr.cpp b/source/platform/pconveyr.cpp index 35195af8e..e07f5361d 100644 --- a/source/platform/pconveyr.cpp +++ b/source/platform/pconveyr.cpp @@ -87,7 +87,7 @@ void CNpcConveyorPlatformGenerator::think( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcConveyorPlatformGenerator::getThinkBBox() +/*const CRECT *CNpcConveyorPlatformGenerator::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -98,7 +98,7 @@ const CRECT *CNpcConveyorPlatformGenerator::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} +}*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -183,7 +183,7 @@ void CNpcConveyorPlatform::processMovement( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcConveyorPlatform::getThinkBBox() +/*const CRECT *CNpcConveyorPlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -194,7 +194,7 @@ const CRECT *CNpcConveyorPlatform::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} +}*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/pconveyr.h b/source/platform/pconveyr.h index ac1e7b247..4325b94d3 100644 --- a/source/platform/pconveyr.h +++ b/source/platform/pconveyr.h @@ -22,7 +22,7 @@ class CNpcConveyorPlatform : public CNpcPlatform { public: virtual void postInit(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); virtual void render(); virtual int checkCollisionAgainst(CThing *_thisThing, int _frames); protected: @@ -37,7 +37,7 @@ class CNpcConveyorPlatformGenerator : public CNpcPlatform { public: virtual void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void think( int _frames ); virtual void collidedWith(CThing *_thisThing); diff --git a/source/platform/pdrop.cpp b/source/platform/pdrop.cpp index 5c2223e03..81354d9f4 100644 --- a/source/platform/pdrop.cpp +++ b/source/platform/pdrop.cpp @@ -38,7 +38,7 @@ void CNpcDropPlatform::processMovement( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcDropPlatform::getThinkBBox() +/*const CRECT *CNpcDropPlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -49,4 +49,4 @@ const CRECT *CNpcDropPlatform::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/platform/pdrop.h b/source/platform/pdrop.h index 4cc991ac2..a18d058d3 100644 --- a/source/platform/pdrop.h +++ b/source/platform/pdrop.h @@ -20,8 +20,8 @@ class CNpcDropPlatform : public CNpcPlatform { -public: - virtual CRECT const *getThinkBBox(); +//public: + //virtual CRECT const *getThinkBBox(); protected: virtual void processMovement( int _frames ); }; diff --git a/source/platform/pdual.cpp b/source/platform/pdual.cpp index 2c3342568..bb7989625 100644 --- a/source/platform/pdual.cpp +++ b/source/platform/pdual.cpp @@ -127,6 +127,16 @@ void CNpcDualPlatform::setWaypoints( sThingPlatform *ThisPlatform ) setLineBase( Pos ); m_otherPlatform->setLineBase( slavePos ); } + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -311,7 +321,7 @@ void CNpcDualPlatform::render() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcDualPlatform::getThinkBBox() +/*const CRECT *CNpcDualPlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -322,7 +332,7 @@ const CRECT *CNpcDualPlatform::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} +}*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/pdual.h b/source/platform/pdual.h index 850aa13c9..55c2f7e06 100644 --- a/source/platform/pdual.h +++ b/source/platform/pdual.h @@ -28,7 +28,7 @@ public: void setLineBase( DVECTOR base ) {m_lineBase = base;} DVECTOR getLineBase() {return( m_lineBase );} virtual void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void setWaypoints( sThingPlatform *ThisPlatform ); virtual void processMovement( int _frames ); diff --git a/source/platform/pjellfsh.cpp b/source/platform/pjellfsh.cpp index 9a4120b6c..abcb0afe5 100644 --- a/source/platform/pjellfsh.cpp +++ b/source/platform/pjellfsh.cpp @@ -150,7 +150,7 @@ void CNpcJellyfishPlatform::think( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcJellyfishPlatform::getThinkBBox() +/*const CRECT *CNpcJellyfishPlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -161,4 +161,4 @@ const CRECT *CNpcJellyfishPlatform::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/platform/pjellfsh.h b/source/platform/pjellfsh.h index 260f70f67..30a25aac7 100644 --- a/source/platform/pjellfsh.h +++ b/source/platform/pjellfsh.h @@ -23,7 +23,7 @@ class CNpcJellyfishPlatform : public CNpcLinearPlatform public: virtual void postInit(); virtual void think( int _frames ); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void collidedWith(CThing *_thisThing); diff --git a/source/platform/plantern.cpp b/source/platform/plantern.cpp index ea20d640f..ea95c5e35 100644 --- a/source/platform/plantern.cpp +++ b/source/platform/plantern.cpp @@ -81,6 +81,16 @@ void CNpcLanternPlatform::setWaypoints( sThingPlatform *ThisPlatform ) { init( startPos ); } + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -116,7 +126,7 @@ void CNpcLanternPlatform::processMovement( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcLanternPlatform::getThinkBBox() +/*const CRECT *CNpcLanternPlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -127,4 +137,4 @@ const CRECT *CNpcLanternPlatform::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} +}*/ diff --git a/source/platform/plantern.h b/source/platform/plantern.h index d4d558aa3..561cdb7c6 100644 --- a/source/platform/plantern.h +++ b/source/platform/plantern.h @@ -22,7 +22,7 @@ class CNpcLanternPlatform : public CNpcPlatform { public: virtual void postInit(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void setWaypoints( sThingPlatform *ThisPlatform ); virtual void processMovement( int _frames ); diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index 6a813eaaa..6e33ac688 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -555,6 +555,16 @@ void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform ) setWaypointCount( ThisPlatform->PointCount - 1 ); setWaypointPtr( waypoints ); + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/platform.h b/source/platform/platform.h index 9c3f554ca..dd62ce996 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -125,6 +125,7 @@ public: virtual void jump() {;} virtual void leftThinkZone(int _frames); s16 getCollisionAngle() {return m_collisionAngle;} + virtual CRECT const *getThinkBBox() {return &m_thinkArea;} static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType ); static CNpcPlatform *Create(int Type); @@ -246,6 +247,7 @@ protected: virtual void setCollisionAngle(int newAngle); // Actually.. this probly doesn't need to be in the base calss anymore.. :/ s16 m_collisionAngle; + CRECT m_thinkArea; }; diff --git a/source/platform/plift.cpp b/source/platform/plift.cpp index c8b011f49..a0c16c613 100644 --- a/source/platform/plift.cpp +++ b/source/platform/plift.cpp @@ -65,6 +65,16 @@ void CNpcLiftPlatform::setWaypoints( sThingPlatform *ThisPlatform ) PntList++; m_maxExtension = ( ( newYPos << 4 ) + 16 ) - startPos.vy; + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/plinear.cpp b/source/platform/plinear.cpp index b0fa3996b..38130fb01 100644 --- a/source/platform/plinear.cpp +++ b/source/platform/plinear.cpp @@ -139,7 +139,7 @@ void CNpcLinearPlatform::processMovement( int _frames ) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcLinearPlatform::getThinkBBox() +/*const CRECT *CNpcLinearPlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -150,4 +150,4 @@ const CRECT *CNpcLinearPlatform::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/platform/plinear.h b/source/platform/plinear.h index 381f71b9d..b77cd8faf 100644 --- a/source/platform/plinear.h +++ b/source/platform/plinear.h @@ -22,7 +22,7 @@ class CNpcLinearPlatform : public CNpcPlatform { public: virtual void postInit(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void processMovement( int _frames ); }; diff --git a/source/platform/ppendulm.cpp b/source/platform/ppendulm.cpp index e74995978..06a81ed2a 100644 --- a/source/platform/ppendulm.cpp +++ b/source/platform/ppendulm.cpp @@ -88,7 +88,14 @@ void CNpcPendulumPlatform::setWaypoints( sThingPlatform *ThisPlatform ) else { init( startPos ); + + m_length = 200; } + + m_thinkArea.x1 = Pos.vx - m_length; + m_thinkArea.x2 = Pos.vx + m_length; + m_thinkArea.y1 = Pos.vy - m_length; + m_thinkArea.y2 = Pos.vy + m_length; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -192,7 +199,7 @@ void CNpcPendulumPlatform::render() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcPendulumPlatform::getThinkBBox() +/*const CRECT *CNpcPendulumPlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -200,4 +207,4 @@ const CRECT *CNpcPendulumPlatform::getThinkBBox() objThinkBox.y1 = thinkBBox.YMax - 1; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/platform/ppendulm.h b/source/platform/ppendulm.h index cbb3f3e7e..9a213deff 100644 --- a/source/platform/ppendulm.h +++ b/source/platform/ppendulm.h @@ -23,7 +23,7 @@ class CNpcPendulumPlatform : public CNpcPlatform public: virtual void postInit(); virtual void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void setWaypoints( sThingPlatform *ThisPlatform ); virtual void processMovement( int _frames ); diff --git a/source/platform/praft.cpp b/source/platform/praft.cpp index 90c49b85e..e892831cd 100644 --- a/source/platform/praft.cpp +++ b/source/platform/praft.cpp @@ -214,7 +214,7 @@ void CNpcRaftPlatform::render() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -const CRECT *CNpcRaftPlatform::getThinkBBox() +/*const CRECT *CNpcRaftPlatform::getThinkBBox() { CRECT objThinkBox = getCollisionArea(); @@ -225,4 +225,4 @@ const CRECT *CNpcRaftPlatform::getThinkBBox() objThinkBox.y2 = thinkBBox.YMax; return &objThinkBox; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source/platform/praft.h b/source/platform/praft.h index eb945b126..4b88a2027 100644 --- a/source/platform/praft.h +++ b/source/platform/praft.h @@ -23,7 +23,7 @@ class CNpcRaftPlatform : public CNpcPlatform public: virtual void postInit(); virtual void render(); - virtual CRECT const *getThinkBBox(); + //virtual CRECT const *getThinkBBox(); protected: virtual void processMovement( int _frames ); diff --git a/source/platform/prbridge.cpp b/source/platform/prbridge.cpp index 0fce30ccb..c1ef1869b 100644 --- a/source/platform/prbridge.cpp +++ b/source/platform/prbridge.cpp @@ -90,6 +90,16 @@ void CNpcRisingBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform ) trigger->setPositionAndSize( ( newXPos << 4 ) + 8, ( newYPos << 4 ) + 16, 100, 0 ); //trigger->setTargetBox(TriggerList->TargetPos.X<<4,TriggerList->TargetPos.Y<<4,TriggerList->TargetSize.X<<4,TriggerList->TargetSize.Y<<4); trigger->setPlatform( this ); + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/psswitch.cpp b/source/platform/psswitch.cpp index 87dfc8bc8..00360dfef 100644 --- a/source/platform/psswitch.cpp +++ b/source/platform/psswitch.cpp @@ -168,6 +168,16 @@ void CNpcSteamSwitchPlatform::setWaypoints( sThingPlatform *ThisPlatform ) trigger=(CSteamSwitchEmitterTrigger*)CTrigger::Create(CTrigger::TRIGGER_STEAM_SWITCH_EMITTER); trigger->setPositionAndSize( ( newXPos << 4 ) + 8, ( newYPos << 4 ) + 16 - 50, 100, 100 ); trigger->toggleVisible(); + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/platform/ptrpdoor.cpp b/source/platform/ptrpdoor.cpp index af608b105..76e147c19 100644 --- a/source/platform/ptrpdoor.cpp +++ b/source/platform/ptrpdoor.cpp @@ -89,6 +89,16 @@ void CNpcTrapdoorPlatform::setWaypoints( sThingPlatform *ThisPlatform ) m_triggerPos.vx = newXPos; m_triggerPos.vy = newYPos; + + s32 minX, maxX, minY, maxY; + + m_npcPath.getPathXExtents( &minX, &maxX ); + m_npcPath.getPathYExtents( &minY, &maxY ); + + m_thinkArea.x1 = minX; + m_thinkArea.x2 = maxX; + m_thinkArea.y1 = minY; + m_thinkArea.y2 = maxY; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////