Moved ExploObject to CPhysics::EventFrame, it shouldn't crash anymore.
dev-ui
MrSimbax 2014-03-08 23:20:39 +01:00
parent a61da7404b
commit 3dd400810f
1 changed files with 7 additions and 7 deletions

View File

@ -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;