Fixed failed assertion when non-damageable objects get fall damage (closes #764)
parent
71a77c77f6
commit
0d12dedd90
|
@ -1576,12 +1576,15 @@ bool CPhysics::EventFrame(const Event &event)
|
||||||
SoundMotor(event.rTime);
|
SoundMotor(event.rTime);
|
||||||
|
|
||||||
if ( m_bLand && m_fallingHeight != 0.0f ) // if fell
|
if ( m_bLand && m_fallingHeight != 0.0f ) // if fell
|
||||||
|
{
|
||||||
|
if (m_object->Implements(ObjectInterfaceType::Damageable))
|
||||||
{
|
{
|
||||||
float force = (m_fallingHeight - m_object->GetPosition().y) * m_fallDamageFraction;
|
float force = (m_fallingHeight - m_object->GetPosition().y) * m_fallDamageFraction;
|
||||||
if (m_object->DamageObject(DamageType::Fall, force))
|
if (m_object->DamageObject(DamageType::Fall, force))
|
||||||
{
|
{
|
||||||
return false; // ugly hack, but works for 0.1.6 release :/
|
return false; // ugly hack, but works for 0.1.6 release :/
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_fallingHeight = 0.0f;
|
m_fallingHeight = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue