816 {
817 int health = -1;
818
820 {
821 return health;
822 }
823
826 {
828 }
829
830 if (tgObject)
831 {
834
835
836 if (!tgObject.IsAlive())
837 {
840 health = -2;
841 else
842 health = tgObject.GetHealthLevel();
843
844 return health;
845 }
846
847 if (tgParent && (tgParent.IsItemBase() || tgParent.IsTransport() || tgParent.CanUseConstruction()))
848 {
849 targetEntity =
EntityAI.Cast(tgParent);
850 }
851
852 if (tgObject.IsItemBase() || tgObject.IsTransport() || tgObject.CanUseConstruction())
853 {
854 targetEntity =
EntityAI.Cast(tgObject);
855 }
856
857 if (targetEntity)
858 {
859 if (!targetEntity.IsDamageDestroyed())
860 {
861 string zone = "";
862 array<string> selections = new array<string>();
863
864 if (targetEntity.IsInherited(TentBase) && TentBase.Cast(targetEntity).GetState() != TentBase.PACKED)
865 {
866
867 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, tgObject.GetActionComponentName(
m_Target.GetComponentIndex(), LOD.NAME_FIRE), zone))
868 {
869 health = targetEntity.GetHealthLevel(zone);
870 }
871 }
872 else
873 {
874
875 targetEntity.GetActionComponentNameList(
m_Target.GetComponentIndex(), selections, LOD.NAME_VIEW);
876
877 for (int s = 0; s < selections.Count(); s++)
878 {
879 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity , selections[s], zone))
880 {
881 health = targetEntity.GetHealthLevel(zone);
882 break;
883 }
884 }
885 }
886
887 if (zone == "")
888 health = targetEntity.GetHealthLevel();
889 }
890 }
891 else
892 {
893 health = tgObject.GetHealthLevel();
894 }
895 }
896
897 return health;
898 }
Object m_DisplayInteractTarget