Fixed #633
parent
274ff64fa5
commit
4062d3d4ef
|
@ -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) ) // (*)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue