This commit is contained in:
Paul 2001-08-10 15:39:05 +00:00
parent ddc2532937
commit 21e520c07c

View File

@ -745,9 +745,26 @@ if(newmode!=-1)
int platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( Pos.vx, Pos.vy );
int height=CGameScene::getCollision()->getHeightFromGround(Pos.vx,Pos.vy,16);
// Hmm.. this *almost* stops him elevating through walls :/
if ( platformOffset < height )
{
Pos.vy += platformOffset;
int goingToHitWall=false;
int i;
for(i=0;i<2;i++)
{
int x=Pos.vx+((i==0?-checkx:+checkx));
int y=Pos.vy-HEIGHT_FOR_HEAD_COLLISION;
if(getHeightFromGroundNoPlatform(x,y,16)>=0&&getHeightFromGroundNoPlatform(x,y+platformOffset,16)<=0&&((CGameScene::getCollision()->getCollisionBlock(x,y+platformOffset)&COLLISION_TYPE_MASK)!=COLLISION_TYPE_FLAG_NORMAL))
{
goingToHitWall=true;
break;
}
}
if(!goingToHitWall)
{
Pos.vy += platformOffset;
}
}
}
}