This commit is contained in:
parent
a9c6792234
commit
7e0c13ae21
2 changed files with 19 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue