dev-time-step
krzys-h 2015-09-30 20:54:36 +02:00
parent 95f1e3f19a
commit d03ce19fbe
1 changed files with 16 additions and 13 deletions

View File

@ -286,6 +286,22 @@ void COldObject::DeleteObject(bool bAll)
}
}
if (!bAll)
{
if (m_power != nullptr)
{
if (m_power->Implements(ObjectInterfaceType::Old))
dynamic_cast<COldObject*>(m_power)->DeleteObject(bAll);
m_power = nullptr;
}
if (m_cargo != nullptr)
{
if (m_cargo->Implements(ObjectInterfaceType::Old))
dynamic_cast<COldObject*>(m_cargo)->DeleteObject(bAll);
m_cargo = nullptr;
}
}
if ( !bAll ) m_main->CreateShortcuts();
}
@ -536,19 +552,6 @@ 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) ) // (*)