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

Method SyncInvulnerability

src/Ext/Techno/Body.cpp:152–168  ·  view source on GitHub ↗

Syncs Iron Curtain or Force Shield timer to another techno.

Source from the content-addressed store, hash-verified

150
151// Syncs Iron Curtain or Force Shield timer to another techno.
152void TechnoExt::SyncInvulnerability(TechnoClass* pFrom, TechnoClass* pTo)
153{
154 if (pFrom->IsIronCurtained())
155 {
156 const auto pTypeExt = TechnoExt::ExtMap.Find(pFrom)->TypeExtData;
157 const bool isForceShielded = pFrom->ForceShielded;
158 const bool allowSyncing = !isForceShielded ? pTypeExt->IronCurtain_KeptOnDeploy.Get(RulesExt::Global()->IronCurtain_KeptOnDeploy) :
159 pTypeExt->ForceShield_KeptOnDeploy.Get(RulesExt::Global()->ForceShield_KeptOnDeploy);
160
161 if (allowSyncing)
162 {
163 pTo->IronCurtainTimer = pFrom->IronCurtainTimer;
164 pTo->IronTintStage = pFrom->IronTintStage;
165 pTo->ForceShielded = isForceShielded;
166 }
167 }
168}
169
170double TechnoExt::GetCurrentSpeedMultiplier(FootClass* pThis)
171{

Callers

nothing calls this directly

Calls 2

FindMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected