master
krzys-h 2015-09-13 20:43:11 +02:00
parent 274ff64fa5
commit 4062d3d4ef
2 changed files with 17 additions and 4 deletions

View File

@ -326,9 +326,6 @@ void COldObject::Simplify()
m_auto.reset();
}
m_power = nullptr;
m_cargo = nullptr;
m_main->CreateShortcuts();
}
@ -539,6 +536,19 @@ void COldObject::DestroyObject(DestructionType type)
m_team = 0; // Back to neutral on destruction
if (m_power != nullptr)
{
if (m_power->Implements(ObjectInterfaceType::Old))
dynamic_cast<COldObject*>(m_power)->m_transporter = nullptr;
m_power = nullptr;
}
if (m_cargo != nullptr)
{
if (m_cargo->Implements(ObjectInterfaceType::Old))
dynamic_cast<COldObject*>(m_cargo)->m_transporter = nullptr;
m_cargo = nullptr;
}
if ( m_botVar != nullptr )
{
if ( Implements(ObjectInterfaceType::Transportable) ) // (*)

View File

@ -1578,7 +1578,10 @@ bool CPhysics::EventFrame(const Event &event)
if ( m_bLand && m_fallingHeight != 0.0f ) // if fell
{
float force = (m_fallingHeight - m_object->GetPosition().y) * m_fallDamageFraction;
m_object->DamageObject(DamageType::Fall, force);
if (m_object->DamageObject(DamageType::Fall, force))
{
return false; // ugly hack, but works for 0.1.6 release :/
}
m_fallingHeight = 0.0f;
}