Fixed #639
parent
95f1e3f19a
commit
d03ce19fbe
|
@ -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();
|
if ( !bAll ) m_main->CreateShortcuts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,19 +552,6 @@ void COldObject::DestroyObject(DestructionType type)
|
||||||
|
|
||||||
m_team = 0; // Back to neutral on destruction
|
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 ( m_botVar != nullptr )
|
||||||
{
|
{
|
||||||
if ( Implements(ObjectInterfaceType::Transportable) ) // (*)
|
if ( Implements(ObjectInterfaceType::Transportable) ) // (*)
|
||||||
|
|
Loading…
Reference in New Issue