855 {
856 int health = -1;
857
859 {
860 return health;
861 }
862
865 {
867 }
868
869 if (tgObject)
870 {
873
874
875 if (!tgObject.IsAlive())
876 {
879 health = -2;
880 else
881 health = tgObject.GetHealthLevel();
882
883 return health;
884 }
885
886 if (tgParent && (tgParent.IsItemBase() || tgParent.IsTransport()))
887 {
888 targetEntity =
EntityAI.Cast(tgParent);
889 }
890
891 if (tgObject.IsItemBase() || tgObject.IsTransport())
892 {
893 targetEntity =
EntityAI.Cast(tgObject);
894 }
895
896 if (targetEntity)
897 {
898 if (!targetEntity.IsDamageDestroyed())
899 {
900 string zone = "";
901 array<string> selections = new array<string>();
902
903 if (targetEntity.IsInherited(TentBase) && TentBase.Cast(targetEntity).GetState() != TentBase.PACKED)
904 {
905
906 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, tgObject.GetActionComponentName(
m_Target.GetComponentIndex(), LOD.NAME_FIRE), zone))
907 {
908 health = targetEntity.GetHealthLevel(zone);
909 }
910 }
911 else
912 {
913
914 targetEntity.GetActionComponentNameList(
m_Target.GetComponentIndex(), selections, LOD.NAME_VIEW);
915
916 for (int s = 0; s < selections.Count(); s++)
917 {
918 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity , selections[s], zone))
919 {
920 health = targetEntity.GetHealthLevel(zone);
921 break;
922 }
923 }
924 }
925
926 if (zone == "")
927 health = targetEntity.GetHealthLevel();
928 }
929 }
930 else
931 {
932 health = tgObject.GetHealthLevel();
933 }
934 }
935
936 return health;
Object m_DisplayInteractTarget