diff --git a/source/platform/pbgeyser.cpp b/source/platform/pbgeyser.cpp index 8918705be..cad729b5b 100644 --- a/source/platform/pbgeyser.cpp +++ b/source/platform/pbgeyser.cpp @@ -81,8 +81,34 @@ void CNpcGeyserPlatformGenerator::think( int _frames ) startPos.vx += ( -5 + ( getRnd() % 11 ) ); newPlatform->init( startPos ); + CNpcWaypoint *sourceWaypoint = m_npcPath.getWaypointList(); + + if ( sourceWaypoint ) + { + while( sourceWaypoint ) + { + newPlatform->addWaypoint( sourceWaypoint->pos.vx >> 4, sourceWaypoint->pos.vy >> 4 ); + sourceWaypoint = sourceWaypoint->nextWaypoint; + } + } + newPlatform->setLayerCollision( m_layerCollision ); newPlatform->setTiltable( false ); newPlatform->postInit(); } } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +const CRECT *CNpcGeyserPlatformGenerator::getThinkBBox() +{ + CRECT objThinkBox = getCollisionArea(); + + sBBox &thinkBBox = CThingManager::getThinkBBox(); + objThinkBox.x1 = thinkBBox.XMin; + objThinkBox.x2 = thinkBBox.XMax; + objThinkBox.y1 = thinkBBox.YMin; + objThinkBox.y2 = thinkBBox.YMax; + + return &objThinkBox; +} \ No newline at end of file diff --git a/source/platform/pbgeyser.h b/source/platform/pbgeyser.h index bd05590cf..65b84d82f 100644 --- a/source/platform/pbgeyser.h +++ b/source/platform/pbgeyser.h @@ -23,6 +23,7 @@ class CNpcGeyserPlatformGenerator : public CNpcPlatform public: void setTargetType( NPC_PLATFORM_UNIT_TYPE targetType ) {m_targetType = targetType;} virtual void render(); + virtual CRECT const *getThinkBBox(); protected: virtual void think( int _frames ); virtual void collidedWith(CThing *_thisThing); diff --git a/source/platform/pbubble.cpp b/source/platform/pbubble.cpp index 7e1d1c00e..8f779b50b 100644 --- a/source/platform/pbubble.cpp +++ b/source/platform/pbubble.cpp @@ -19,11 +19,28 @@ void CNpcBubblePlatform::processMovement( int _frames ) { - Pos.vy -= m_speed * _frames; - - if ( Pos.vy < 0 ) + if ( !isSetToShutdown() ) { - setToShutdown(); + Pos.vy -= m_speed * _frames; + + if ( m_npcPath.getWaypointCount() > 1 ) + { + s32 minY, maxY; + + m_npcPath.getPathYExtents( &minY, &maxY ); + + if ( Pos.vy < minY ) + { + setToShutdown(); + } + } + else + { + if ( Pos.vy < 0 ) + { + setToShutdown(); + } + } } }