This commit is contained in:
parent
d8a19f121e
commit
5896d4e186
3 changed files with 48 additions and 2 deletions
|
@ -855,7 +855,7 @@ if(PadGetDown(0)&PAD_TRIANGLE)
|
|||
}
|
||||
|
||||
// Death?
|
||||
else if(m_currentMode!=PLAYER_MODE_DEAD&&
|
||||
/*else if(m_currentMode!=PLAYER_MODE_DEAD&&
|
||||
block==COLLISION_TYPE_FLAG_DEATH_LIQUID)
|
||||
{
|
||||
dieYouPorousFreak(DEATHTYPE__LIQUID);
|
||||
|
@ -864,7 +864,7 @@ if(PadGetDown(0)&PAD_TRIANGLE)
|
|||
block==COLLISION_TYPE_FLAG_DEATH_INSTANT)
|
||||
{
|
||||
dieYouPorousFreak(DEATHTYPE__NORMAL);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
// Powerups
|
||||
|
@ -1173,6 +1173,49 @@ if(PadGetDown(0)&PAD_TRIANGLE)
|
|||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayer::detectHazardousSurface()
|
||||
{
|
||||
int height;
|
||||
|
||||
height=CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy );
|
||||
if ( height <= 0 )
|
||||
{
|
||||
CThing *platform;
|
||||
platform=isOnPlatform();
|
||||
if(platform)
|
||||
{
|
||||
int platformHeight=((CNpcPlatform*)platform)->getHeightFromPlatformAtPosition( Pos.vx, Pos.vy );
|
||||
|
||||
if ( platformHeight < height )
|
||||
{
|
||||
// on platform, which is higher than ground
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
|
|
@ -219,6 +219,7 @@ public:
|
|||
virtual void init();
|
||||
virtual void shutdown();
|
||||
virtual void think(int _frames);
|
||||
void detectHazardousSurface();
|
||||
virtual void render();
|
||||
virtual int dontKillDuringLevelRespawn() {return true;}
|
||||
virtual void shove(DVECTOR move);
|
||||
|
|
|
@ -702,6 +702,8 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
|||
}
|
||||
thing1=thing1->m_nextCollisionThing;
|
||||
}
|
||||
|
||||
player->detectHazardousSurface();
|
||||
}
|
||||
// Shut emm down, sh sh shut em down, we shutem down
|
||||
for(i=0;i<CThing::MAX_TYPE;i++)
|
||||
|
|
Loading…
Add table
Reference in a new issue