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