diff --git a/src/object/old_object.cpp b/src/object/old_object.cpp index d327c7a1..ca68afee 100644 --- a/src/object/old_object.cpp +++ b/src/object/old_object.cpp @@ -286,6 +286,22 @@ void COldObject::DeleteObject(bool bAll) } } + if (!bAll) + { + if (m_power != nullptr) + { + if (m_power->Implements(ObjectInterfaceType::Old)) + dynamic_cast(m_power)->DeleteObject(bAll); + m_power = nullptr; + } + if (m_cargo != nullptr) + { + if (m_cargo->Implements(ObjectInterfaceType::Old)) + dynamic_cast(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(m_power)->m_transporter = nullptr; - m_power = nullptr; - } - if (m_cargo != nullptr) - { - if (m_cargo->Implements(ObjectInterfaceType::Old)) - dynamic_cast(m_cargo)->m_transporter = nullptr; - m_cargo = nullptr; - } - if ( m_botVar != nullptr ) { if ( Implements(ObjectInterfaceType::Transportable) ) // (*)