diff --git a/source/game/game.cpp b/source/game/game.cpp index c849e1eaa..3620448ab 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -721,7 +721,7 @@ int CGameScene::getTotalSpatCountForThisLevel() /*****************************************************************************/ int CGameScene::triggerTeleportEffect() { - if(m_gamestate==GAMESTATE_PLAYING&&!m_player->isDead()) + if(m_gamestate==GAMESTATE_PLAYING) { m_gamestate=GAMESTATE_TELEPORT_START; CFader::setFadingOut(); @@ -776,7 +776,7 @@ void CGameScene::setBossHasBeenKilled() /*****************************************************************************/ void CGameScene::hitBossArenaTrigger() { - if(!s_showBossTextOnRespawn&&!m_player->isDead()) + if(!s_showBossTextOnRespawn) { s_justHitBossArenaTrigger=true; s_showBossTextOnRespawn=true; diff --git a/source/player/player.cpp b/source/player/player.cpp index 26fe08109..ea62cde66 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -737,52 +737,54 @@ if(newmode!=-1) newmode=-1; } - CThing *platform; - platform=isOnPlatform(); - if(platform) + if(!isDead()) { - if ( ( (CNpcPlatform *) platform )->isCart() ) + CThing *platform; + platform=isOnPlatform(); + if(platform) { - if ( m_currentMode != PLAYER_MODE_CART && m_currentMode != PLAYER_MODE_DEAD ) + if ( ( (CNpcPlatform *) platform )->isCart() ) { - setMode( PLAYER_MODE_CART ); - } - } - else - { - DVECTOR posDelta; - posDelta=platform->getPosDelta(); - posDelta.vy = 0; - shove(posDelta); - - 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++) + if ( m_currentMode != PLAYER_MODE_CART && m_currentMode != PLAYER_MODE_DEAD ) { - 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; - } + setMode( PLAYER_MODE_CART ); } + } + else + { + DVECTOR posDelta; + posDelta=platform->getPosDelta(); + posDelta.vy = 0; + shove(posDelta); - if(!goingToHitWall) + 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; + } } } } } - m_allowConversation=false; m_xMove = Pos.vx; diff --git a/source/triggers/tboss.cpp b/source/triggers/tboss.cpp index 4f52830ea..edcf44bcc 100644 --- a/source/triggers/tboss.cpp +++ b/source/triggers/tboss.cpp @@ -60,7 +60,7 @@ void CBossArenaTrigger::collidedWith(CThing *_thisThing) { case TYPE_PLAYER: { - CGameScene::hitBossArenaTrigger(); + GameScene.hitBossArenaTrigger(); shutdown(); delete this; break;