MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LockPossible

Method LockPossible

engine/Poseidon/AI/VehicleAI.cpp:671–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669}
670
671bool EntityAI::LockPossible(const AmmoType* ammo) const
672{
673 const EntityAIType* type = GetType();
674 // laser target can locked with laser capable weapon only
675 if (type->GetLaserTarget())
676 {
677 return ammo->laserLock;
678 }
679 if (ammo->laserLock && !ammo->irLock)
680 {
681 if (!type->GetLaserTarget())
682 {
683 return false;
684 }
685 }
686 // disable locking of airborne targets
687 if (Airborne())
688 {
689 if (!ammo->airLock)
690 {
691 return false;
692 }
693 }
694 // some weapons can lock only ir targets
695 if (!type->GetIRTarget() && ammo->irLock)
696 {
697 return false;
698 }
699 return true;
700}
701
702void EntityAIType::AddHitPoints(const ParamEntry& par)
703{

Callers 5

WhatShootResultMethod · 0.80
SimulateMethod · 0.80
SimulateUnitsMethod · 0.80
CanLockMethod · 0.80
SimulateHUDMethod · 0.80

Calls 4

AirborneFunction · 0.85
GetIRTargetMethod · 0.80
GetTypeFunction · 0.50
GetLaserTargetMethod · 0.45

Tested by

no test coverage detected