Fix crash when destroying unpowered PowerPlant with Titanium

Appendix to pull #1206
1008-fix
tomangelo2 2019-01-30 21:06:07 +01:00 committed by Mateusz Przybył
parent 0f6e1d7d4a
commit a46750ede2
1 changed files with 2 additions and 0 deletions

View File

@ -82,12 +82,14 @@ void CAutoPowerPlant::DeleteObject(bool all)
CObject* cargo = SearchMetal();
if ( cargo != nullptr )
{
m_object->SetPower(nullptr);
CObjectManager::GetInstancePointer()->DeleteObject(cargo);
}
cargo = SearchPower();
if ( cargo != nullptr )
{
m_object->SetPower(nullptr);
CObjectManager::GetInstancePointer()->DeleteObject(cargo);
}
}