This commit is contained in:
Charles 2001-05-25 20:45:03 +00:00
parent fbef1ce5e7
commit 85c497b6cf
2 changed files with 21 additions and 8 deletions

View File

@ -22,6 +22,9 @@ void CNpcFishHook3Platform::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();
setCollisionAngle( m_tiltAngle >> 8 );
m_isMoving = false; m_isMoving = false;
m_isResetting = false; m_isResetting = false;
m_isShuttingDown = false; m_isShuttingDown = false;

View File

@ -712,12 +712,17 @@ if(newmode!=-1)
if(platform) if(platform)
{ {
int platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( Pos.vx, Pos.vy ); int platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( Pos.vx, Pos.vy );
Pos.vy += platformOffset; int height=CGameScene::getCollision()->getHeightFromGround(Pos.vx,Pos.vy,16);
DVECTOR posDelta; if ( platformOffset < height )
posDelta=platform->getPosDelta(); {
posDelta.vy = 0; Pos.vy += platformOffset;
shove(posDelta);
DVECTOR posDelta;
posDelta=platform->getPosDelta();
posDelta.vy = 0;
shove(posDelta);
}
/*if(((CNpcPlatform*)platform)->getHeightFromPlatformAtPosition(Pos.vx+posDelta.vx,Pos.vy+posDelta.vy)==0) /*if(((CNpcPlatform*)platform)->getHeightFromPlatformAtPosition(Pos.vx+posDelta.vx,Pos.vy+posDelta.vy)==0)
{ {
shove(posDelta); shove(posDelta);
@ -1293,9 +1298,14 @@ int CPlayer::getHeightFromGround(int _x,int _y,int _maxHeight)
platform=isOnPlatform(); platform=isOnPlatform();
if(platform) if(platform)
{ {
height=((CNpcPlatform*)platform)->getHeightFromPlatformAtPosition(_x,_y); int platformHeight=((CNpcPlatform*)platform)->getHeightFromPlatformAtPosition(_x,_y);
if(height>_maxHeight)height=_maxHeight;
else if(height<-_maxHeight)height=-_maxHeight; if ( platformHeight < height )
{
height = platformHeight;
if(height>_maxHeight)height=_maxHeight;
else if(height<-_maxHeight)height=-_maxHeight;
}
} }
} }