MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / ~ExtData

Method ~ExtData

src/Ext/Techno/Body.cpp:17–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15UnitClass* TechnoExt::Deployer = nullptr;
16
17TechnoExt::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
55bool TechnoExt::IsActiveIgnoreEMP(TechnoClass* pThis)
56{

Callers

nothing calls this directly

Calls 6

issetMethod · 0.80
eraseMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
FindMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected