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

Method UpdateShield

src/Ext/Techno/Body.Update.cpp:427–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427void TechnoExt::ExtData::UpdateShield()
428{
429 // Set current shield type if it is not set.
430 if (!this->CurrentShieldType || this->CurrentShieldType->Strength <= 0)
431 {
432 auto const pTypeExt = this->TypeExtData;
433
434 if (pTypeExt->ShieldType && pTypeExt->ShieldType->Strength > 0)
435 this->CurrentShieldType = pTypeExt->ShieldType;
436 }
437
438 // Create shield class instance if it does not exist.
439 if (this->CurrentShieldType && this->CurrentShieldType->Strength > 0 && !this->Shield)
440 {
441 this->Shield = std::make_unique<ShieldClass>(this->OwnerObject());
442 this->Shield->UpdateTint();
443 }
444
445 if (const auto pShieldData = this->Shield.get())
446 pShieldData->AI();
447}
448
449void TechnoExt::ExtData::UpdateOnTunnelEnter()
450{

Callers 1

OnEarlyUpdateMethod · 0.95

Calls 3

UpdateTintMethod · 0.80
getMethod · 0.45
AIMethod · 0.45

Tested by

no test coverage detected