From 3a83575bac0392fd4b75f7e97734129c9a02667b Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 30 May 2001 21:00:50 +0000 Subject: [PATCH] --- source/player/psbutt.cpp | 16 +++++++++++++--- source/player/psbutt.h | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/source/player/psbutt.cpp b/source/player/psbutt.cpp index 246f3b614..42dc5b32b 100644 --- a/source/player/psbutt.cpp +++ b/source/player/psbutt.cpp @@ -133,14 +133,19 @@ void CPlayerStateButtBounceFall::think(CPlayerModeBase *_playerMode) ---------------------------------------------------------------------- */ void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode) { + m_bounceOffFloor=false; if(_playerMode->getIsInWater()) { DVECTOR pos; - CLevel &level=GameScene.GetLevel(); pos=_playerMode->getPlayerPos(); - CGameBubicleFactory::spawnBubicles(pos.vx-20,pos.vy,40,10,CGameBubicleFactory::TYPE_MEDIUM); - level.destroyMapArea(pos); + if((CGameScene::getCollision()->getCollisionBlock(pos.vx,pos.vy)&COLLISION_TYPE_MASK)==COLLISION_TYPE_FLAG_DESTRUCTABLE_WALL) + { + CLevel &level=GameScene.GetLevel(); + CGameBubicleFactory::spawnBubicles(pos.vx-20,pos.vy,40,10,CGameBubicleFactory::TYPE_MEDIUM); + level.destroyMapArea(pos); + m_bounceOffFloor=true; + } } } @@ -153,6 +158,11 @@ void CPlayerStateButtBounceLand::enter(CPlayerModeBase *_playerMode) ---------------------------------------------------------------------- */ void CPlayerStateButtBounceLand::think(CPlayerModeBase *_playerMode) { + if(m_bounceOffFloor) + { + _playerMode->setState(STATE_BUTTBOUNCEUP); + } + if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { _playerMode->setState(STATE_IDLE); diff --git a/source/player/psbutt.h b/source/player/psbutt.h index 7e9ee121e..97c014b76 100644 --- a/source/player/psbutt.h +++ b/source/player/psbutt.h @@ -54,6 +54,9 @@ public: virtual void enter(class CPlayerModeBase *_playerMode); virtual void think(class CPlayerModeBase *_playerMode); +private: + int m_bounceOffFloor; + }; class CPlayerStateButtBounceUp : public CPlayerState