| 669 | } |
| 670 | |
| 671 | bool 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 | |
| 702 | void EntityAIType::AddHitPoints(const ParamEntry& par) |
| 703 | { |
no test coverage detected