| 425 | } |
| 426 | |
| 427 | void 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 | |
| 449 | void TechnoExt::ExtData::UpdateOnTunnelEnter() |
| 450 | { |
no test coverage detected