This commit is contained in:
Charles 2001-06-28 15:34:05 +00:00
parent a9c6792234
commit 7e0c13ae21
2 changed files with 19 additions and 2 deletions

View file

@ -43,6 +43,8 @@ void CNpcCartPlatform::postInit()
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) ); setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 ); setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 );
calculateNonRotatedCollisionData(); calculateNonRotatedCollisionData();
m_playerAttached = false;
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -58,6 +60,20 @@ void CNpcCartPlatform::processMovement( int _frames )
bool pathComplete; 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 ) if ( m_isActivated )
{ {
m_npcPath.thinkFlat( Pos, &pathComplete, &distX, &distY, &heading ); m_npcPath.thinkFlat( Pos, &pathComplete, &distX, &distY, &heading );
@ -74,7 +90,7 @@ void CNpcCartPlatform::processMovement( int _frames )
if ( m_inJump ) if ( m_inJump )
{ {
m_vertSpeed += 64; m_vertSpeed += 192;
if ( m_vertSpeed > ( 5 << 8 ) ) if ( m_vertSpeed > ( 5 << 8 ) )
{ {
@ -236,7 +252,7 @@ void CNpcCartPlatform::jump()
if ( !m_inJump ) if ( !m_inJump )
{ {
m_inJump = true; m_inJump = true;
m_vertSpeed = -6 << 8; m_vertSpeed = -8 << 8;
} }
} }

View file

@ -33,6 +33,7 @@ protected:
u8 m_isActivated; u8 m_isActivated;
u8 m_inJump; u8 m_inJump;
s32 m_vertSpeed; s32 m_vertSpeed;
u8 m_playerAttached;
}; };
#endif #endif