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

Method SyncShieldToAnother

src/New/Entity/ShieldClass.cpp:127–143  ·  view source on GitHub ↗

============================= Is used for DeploysInto/UndeploysInto

Source from the content-addressed store, hash-verified

125//
126// Is used for DeploysInto/UndeploysInto
127void ShieldClass::SyncShieldToAnother(TechnoClass* pFrom, TechnoClass* pTo)
128{
129 const auto pFromExt = TechnoExt::ExtMap.Find(pFrom);
130 const auto pToExt = TechnoExt::ExtMap.Find(pTo);
131
132 if (pFromExt->Shield)
133 {
134 pToExt->CurrentShieldType = pFromExt->CurrentShieldType;
135 pToExt->Shield = std::make_unique<ShieldClass>(pTo);
136 pToExt->Shield->TechnoID = pFromExt->Shield->TechnoID;
137 pToExt->Shield->Available = pFromExt->Shield->Available;
138 pToExt->Shield->HP = pFromExt->Shield->HP;
139 }
140
141 if (pFrom->WhatAmI() == AbstractType::Building && pFromExt->Shield)
142 pFromExt->Shield = nullptr;
143}
144
145bool ShieldClass::ShieldIsBrokenTEvent(ObjectClass* pAttached)
146{

Callers

nothing calls this directly

Calls 1

FindMethod · 0.45

Tested by

no test coverage detected