From 3dd400810f16657d1f99963f249a8b93f640fdd6 Mon Sep 17 00:00:00 2001 From: MrSimbax Date: Sat, 8 Mar 2014 23:20:39 +0100 Subject: Fixed bug from a61da7404bf8430132864d493c7e75a6b4c3d978 Moved ExploObject to CPhysics::EventFrame, it shouldn't crash anymore. --- src/physics/physics.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/physics/physics.cpp') diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp index c84040e..2ab7425 100644 --- a/src/physics/physics.cpp +++ b/src/physics/physics.cpp @@ -983,13 +983,6 @@ void CPhysics::MotorUpdate(float aTime, float rTime) m_cirMotion.motorSpeed.y = 0.0f; } - if ( m_bLand && m_fallingHeight != 0.0f ) // if fell - { - float force = m_fallingHeight * m_fallDamageFraction; - m_object->ExploObject(EXPLO_BOUM, force); - m_fallingHeight = 0.0f; - } - if ( m_type == TYPE_FLYING && m_bLand ) // flying on the ground? { if ( type == OBJECT_HUMAN || @@ -1621,6 +1614,13 @@ bool CPhysics::EventFrame(const Event &event) MotorParticle(m_time, event.rTime); SoundMotor(event.rTime); + if ( m_bLand && m_fallingHeight != 0.0f ) // if fell + { + float force = m_fallingHeight * m_fallDamageFraction; + m_object->ExploObject(EXPLO_BOUM, force); + m_fallingHeight = 0.0f; + } + m_bForceUpdate = false; return true; -- cgit v1.2.3-1-g7c22