Fix crash when replacing power cell

master
Piotr Dziwinski 2015-07-12 13:19:41 +02:00
parent a1e5812740
commit fdb594b9f7
1 changed files with 1 additions and 1 deletions

View File

@ -529,10 +529,10 @@ bool CTaskTake::TransporterDeposeObject()
CObject* cargo = dynamic_cast<CPoweredObject*>(other)->GetPower();
if (cargo != nullptr) return false; // the other already has a battery?
assert(cargo->Implements(ObjectInterfaceType::Transportable));
cargo = m_carrierObject->GetCargo();
if (cargo == nullptr) return false;
assert(cargo->Implements(ObjectInterfaceType::Transportable));
m_cargoType = cargo->GetType();
dynamic_cast<CPoweredObject*>(other)->SetPower(cargo);