This commit is contained in:
parent
e58199b54e
commit
08768b4145
1 changed files with 26 additions and 27 deletions
|
@ -1219,37 +1219,36 @@ 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++)
|
||||||
{
|
{
|
||||||
// on platform, which is higher than ground
|
int x,height;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
x=pos.vx+(i==0?-checkx:checkx);
|
||||||
|
height=CGameScene::getCollision()->getHeightFromGround(x,pos.vy);
|
||||||
|
if(height<=0)
|
||||||
|
{
|
||||||
int block;
|
int block;
|
||||||
block=CGameScene::getCollision()->getCollisionBlock(Pos.vx,Pos.vy)&COLLISION_TYPE_MASK;
|
block=CGameScene::getCollision()->getCollisionBlock(x,pos.vy)&COLLISION_TYPE_MASK;
|
||||||
|
|
||||||
// Death?
|
// Death?
|
||||||
if(m_currentMode!=PLAYER_MODE_DEAD&&
|
if(block==COLLISION_TYPE_FLAG_DEATH_LIQUID)
|
||||||
block==COLLISION_TYPE_FLAG_DEATH_LIQUID)
|
|
||||||
{
|
{
|
||||||
dieYouPorousFreak(DEATHTYPE__LIQUID);
|
dieYouPorousFreak(DEATHTYPE__LIQUID);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if(m_currentMode!=PLAYER_MODE_DEAD&&
|
else if(block==COLLISION_TYPE_FLAG_DEATH_INSTANT)
|
||||||
block==COLLISION_TYPE_FLAG_DEATH_INSTANT)
|
|
||||||
{
|
{
|
||||||
dieYouPorousFreak(DEATHTYPE__NORMAL);
|
dieYouPorousFreak(DEATHTYPE__NORMAL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue