This commit is contained in:
Paul 2001-07-31 20:29:43 +00:00
parent e58199b54e
commit 08768b4145

View file

@ -1219,38 +1219,37 @@ if(newmode!=-1)
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CPlayer::detectHazardousSurface() void CPlayer::detectHazardousSurface()
{ {
int height; // DOn't worry if on platform or already dead
if(!isOnPlatform()&&
height=CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy ); m_currentMode!=PLAYER_MODE_DEAD)
if ( height <= 0 )
{ {
CThing *platform; int i;
platform=isOnPlatform(); DVECTOR const &pos=getPlayerPos();
if(platform)
{
int platformHeight=((CNpcPlatform*)platform)->getHeightFromPlatformAtPosition( Pos.vx, Pos.vy );
if ( platformHeight < height ) for(i=0;i<2;i++)
{
int x,height;
x=pos.vx+(i==0?-checkx:checkx);
height=CGameScene::getCollision()->getHeightFromGround(x,pos.vy);
if(height<=0)
{ {
// on platform, which is higher than ground int block;
return; block=CGameScene::getCollision()->getCollisionBlock(x,pos.vy)&COLLISION_TYPE_MASK;
// Death?
if(block==COLLISION_TYPE_FLAG_DEATH_LIQUID)
{
dieYouPorousFreak(DEATHTYPE__LIQUID);
break;
}
else if(block==COLLISION_TYPE_FLAG_DEATH_INSTANT)
{
dieYouPorousFreak(DEATHTYPE__NORMAL);
break;
}
} }
} }
int block;
block=CGameScene::getCollision()->getCollisionBlock(Pos.vx,Pos.vy)&COLLISION_TYPE_MASK;
// Death?
if(m_currentMode!=PLAYER_MODE_DEAD&&
block==COLLISION_TYPE_FLAG_DEATH_LIQUID)
{
dieYouPorousFreak(DEATHTYPE__LIQUID);
}
else if(m_currentMode!=PLAYER_MODE_DEAD&&
block==COLLISION_TYPE_FLAG_DEATH_INSTANT)
{
dieYouPorousFreak(DEATHTYPE__NORMAL);
}
} }
} }