============================= Is used for DeploysInto/UndeploysInto
| 125 | // |
| 126 | // Is used for DeploysInto/UndeploysInto |
| 127 | void 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 | |
| 145 | bool ShieldClass::ShieldIsBrokenTEvent(ObjectClass* pAttached) |
| 146 | { |