This commit is contained in:
parent
fbef1ce5e7
commit
85c497b6cf
2 changed files with 21 additions and 8 deletions
|
@ -22,6 +22,9 @@ void CNpcFishHook3Platform::postInit()
|
|||
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
|
||||
setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 );
|
||||
|
||||
calculateNonRotatedCollisionData();
|
||||
setCollisionAngle( m_tiltAngle >> 8 );
|
||||
|
||||
m_isMoving = false;
|
||||
m_isResetting = false;
|
||||
m_isShuttingDown = false;
|
||||
|
|
|
@ -712,12 +712,17 @@ if(newmode!=-1)
|
|||
if(platform)
|
||||
{
|
||||
int platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( Pos.vx, Pos.vy );
|
||||
Pos.vy += platformOffset;
|
||||
int height=CGameScene::getCollision()->getHeightFromGround(Pos.vx,Pos.vy,16);
|
||||
|
||||
DVECTOR posDelta;
|
||||
posDelta=platform->getPosDelta();
|
||||
posDelta.vy = 0;
|
||||
shove(posDelta);
|
||||
if ( platformOffset < height )
|
||||
{
|
||||
Pos.vy += platformOffset;
|
||||
|
||||
DVECTOR posDelta;
|
||||
posDelta=platform->getPosDelta();
|
||||
posDelta.vy = 0;
|
||||
shove(posDelta);
|
||||
}
|
||||
/*if(((CNpcPlatform*)platform)->getHeightFromPlatformAtPosition(Pos.vx+posDelta.vx,Pos.vy+posDelta.vy)==0)
|
||||
{
|
||||
shove(posDelta);
|
||||
|
@ -1293,9 +1298,14 @@ int CPlayer::getHeightFromGround(int _x,int _y,int _maxHeight)
|
|||
platform=isOnPlatform();
|
||||
if(platform)
|
||||
{
|
||||
height=((CNpcPlatform*)platform)->getHeightFromPlatformAtPosition(_x,_y);
|
||||
if(height>_maxHeight)height=_maxHeight;
|
||||
else if(height<-_maxHeight)height=-_maxHeight;
|
||||
int platformHeight=((CNpcPlatform*)platform)->getHeightFromPlatformAtPosition(_x,_y);
|
||||
|
||||
if ( platformHeight < height )
|
||||
{
|
||||
height = platformHeight;
|
||||
if(height>_maxHeight)height=_maxHeight;
|
||||
else if(height<-_maxHeight)height=-_maxHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue