diff --git a/source/platform/pcart.cpp b/source/platform/pcart.cpp index c45bee9fa..0d7c6be08 100644 --- a/source/platform/pcart.cpp +++ b/source/platform/pcart.cpp @@ -43,6 +43,8 @@ void CNpcCartPlatform::postInit() setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) ); setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 ); calculateNonRotatedCollisionData(); + + m_playerAttached = false; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -58,6 +60,20 @@ void CNpcCartPlatform::processMovement( int _frames ) bool pathComplete; + if ( !m_playerAttached ) + { + m_playerAttached = true; + CPlayer *player = GameScene.getPlayer(); + + DVECTOR newPos = Pos; + CRECT collisionArea=getCollisionArea(); + newPos.vy = collisionArea.y1; + + player->setPos( newPos ); + player->setPlatform( this ); + m_contact = true; + } + if ( m_isActivated ) { m_npcPath.thinkFlat( Pos, &pathComplete, &distX, &distY, &heading ); @@ -74,7 +90,7 @@ void CNpcCartPlatform::processMovement( int _frames ) if ( m_inJump ) { - m_vertSpeed += 64; + m_vertSpeed += 192; if ( m_vertSpeed > ( 5 << 8 ) ) { @@ -236,7 +252,7 @@ void CNpcCartPlatform::jump() if ( !m_inJump ) { m_inJump = true; - m_vertSpeed = -6 << 8; + m_vertSpeed = -8 << 8; } } diff --git a/source/platform/pcart.h b/source/platform/pcart.h index ed2822fe3..c9a7bdde1 100644 --- a/source/platform/pcart.h +++ b/source/platform/pcart.h @@ -33,6 +33,7 @@ protected: u8 m_isActivated; u8 m_inJump; s32 m_vertSpeed; + u8 m_playerAttached; }; #endif \ No newline at end of file