diff --git a/source/platform/platdata.cpp b/source/platform/platdata.cpp index a97548b18..454b14f9b 100644 --- a/source/platform/platdata.cpp +++ b/source/platform/platdata.cpp @@ -335,7 +335,7 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] = }, { // NPC_STEERABLE_BARREL_PLATFORM - 2, + 3, 128, true, DAMAGE__NONE, diff --git a/source/platform/psbarrel.cpp b/source/platform/psbarrel.cpp index 00d28b544..80546e6e0 100644 --- a/source/platform/psbarrel.cpp +++ b/source/platform/psbarrel.cpp @@ -56,13 +56,37 @@ void CNpcSteerableBarrelPlatform::processMovement( int _frames ) { DVECTOR playerPos = player->getPos(); - s32 playerX = playerPos.vx - this->Pos.vx; + DVECTOR *playerVel = player->getMoveVelocity(); + + s32 speedChange = -playerVel->vx << 8; + + if ( speedChange > ( _frames << 5 ) ) + { + speedChange = _frames << 5; + } + else if ( speedChange < -( _frames << 5 ) ) + { + speedChange = -_frames << 5; + } + + m_currentSpeed += speedChange; + + if ( m_currentSpeed > ( m_speed << 8 ) ) + { + m_currentSpeed = ( m_speed << 8 ); + } + else if ( m_currentSpeed < -( m_speed << 8 ) ) + { + m_currentSpeed = -( m_speed << 8 ); + } + + /*s32 playerX = playerPos.vx - this->Pos.vx; if ( playerX > 5 ) { // increase barrel speed to right - m_currentSpeed += _frames; + m_currentSpeed += _frames << 2; if ( m_currentSpeed > ( m_speed << 8 ) ) { @@ -71,13 +95,13 @@ void CNpcSteerableBarrelPlatform::processMovement( int _frames ) } else if ( playerX < -5 ) { - m_currentSpeed -= _frames; + m_currentSpeed -= _frames << 2; if ( m_currentSpeed < -( m_speed << 8 ) ) { m_currentSpeed = -( m_speed << 8 ); } - } + }*/ } else {