| 15 | UnitClass* TechnoExt::Deployer = nullptr; |
| 16 | |
| 17 | TechnoExt::ExtData::~ExtData() |
| 18 | { |
| 19 | auto const pTypeExt = this->TypeExtData; |
| 20 | auto const pType = pTypeExt->OwnerObject(); |
| 21 | auto const pThis = this->OwnerObject(); |
| 22 | // Besides BuildingClass, calling pThis->WhatAmI() here will only result in AbstractType::None |
| 23 | auto const whatAmI = pType->WhatAmI(); |
| 24 | |
| 25 | if (pTypeExt->AutoDeath_Behavior.isset()) |
| 26 | { |
| 27 | auto& vec = ScenarioExt::Global()->AutoDeathObjects; |
| 28 | vec.erase(std::remove(vec.begin(), vec.end(), this), vec.end()); |
| 29 | } |
| 30 | |
| 31 | if (whatAmI != AbstractType::AircraftType && whatAmI != AbstractType::BuildingType |
| 32 | && pType->Ammo > 0 && pTypeExt->ReloadInTransport) |
| 33 | { |
| 34 | auto& vec = ScenarioExt::Global()->TransportReloaders; |
| 35 | vec.erase(std::remove(vec.begin(), vec.end(), this), vec.end()); |
| 36 | } |
| 37 | |
| 38 | if (this->AnimRefCount > 0) |
| 39 | AnimExt::InvalidateTechnoPointers(pThis); |
| 40 | |
| 41 | if (this->TypeExtData->Harvester_Counted) |
| 42 | { |
| 43 | auto& vec = HouseExt::ExtMap.Find(pThis->Owner)->OwnedCountedHarvesters; |
| 44 | vec.erase(std::remove(vec.begin(), vec.end(), pThis), vec.end()); |
| 45 | } |
| 46 | |
| 47 | for (auto const pBolt : this->ElectricBolts) |
| 48 | { |
| 49 | pBolt->Owner = nullptr; |
| 50 | } |
| 51 | |
| 52 | this->ElectricBolts.clear(); |
| 53 | } |
| 54 | |
| 55 | bool TechnoExt::IsActiveIgnoreEMP(TechnoClass* pThis) |
| 56 | { |