This commit is contained in:
parent
ddc2532937
commit
21e520c07c
@ -745,12 +745,29 @@ 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 )
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_allowConversation=false;
|
||||
|
Loading…
Reference in New Issue
Block a user