diff --git a/source/player/player.cpp b/source/player/player.cpp index d8adb3374..238102ef3 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -741,7 +741,8 @@ if(newmode!=-1) #ifdef __USER_paul__ if(PadGetDown(0)&PAD_TRIANGLE) { - springPlayerUp(); + CLevel &level=GameScene.GetLevel(); + level.destroyMapTile(Pos); } #endif /// @@ -1356,6 +1357,24 @@ if(drawlastpos) } +/*---------------------------------------------------------------------- + Function: + Purpose: Like the normal setRespawnPos() but plays the telephone ring sound if + this is not the current respawn point. To be used from the respawn triggers + so that they make the ring sound + Params: + Returns: + ---------------------------------------------------------------------- */ +void CPlayer::setRespawnPosAndRingTelephone(DVECTOR _respawn) +{ + if(m_respawnPos.vx!=_respawn.vx&& + m_respawnPos.vy!=_respawn.vy) + { + CSoundMediator::playSfx(CSoundMediator::SFX_TELEPHONE_BOX); + setRespawnPos(_respawn); + } +} + /*---------------------------------------------------------------------- Function: Purpose: diff --git a/source/player/player.h b/source/player/player.h index 8ff900586..c5500dffa 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -217,6 +217,7 @@ public: void setCameraBox(CameraBox _cameraBox); void setRespawnPos(DVECTOR _respawn) {m_respawnPos=_respawn;} + void setRespawnPosAndRingTelephone(DVECTOR _respawn); // This isn't funny anymore.. :( int getHeightFromGround(int _x,int _y,int _maxHeight=32); diff --git a/source/triggers/trestart.cpp b/source/triggers/trestart.cpp index 1742251af..06e2d2553 100644 --- a/source/triggers/trestart.cpp +++ b/source/triggers/trestart.cpp @@ -64,7 +64,7 @@ void CRestartPointTrigger::collidedWith(CThing *_thisThing) collisionArea=getCollisionArea(); respawnPos.vx=collisionArea.x1+((collisionArea.x2-collisionArea.x1)/2); respawnPos.vy=collisionArea.y2; - ((CPlayer*)_thisThing)->setRespawnPos(respawnPos); + ((CPlayer*)_thisThing)->setRespawnPosAndRingTelephone(respawnPos); break; }