Page 1 of 1

IsUnitValid(id)

Posted: Thu Jan 08, 2015 10:46 am
by enric
returns 0 if a unit is dead/hidden/inactive (loaded, etc). 1 otherwise

What exactly means "hidden" in this case?, and the "etc" can be more explicit.

Re: IsUnitValid(id)

Posted: Thu Jan 08, 2015 3:55 pm
by pipfromslitherine
I think that basically is talking about if the unit has been removed from the map.

Cheers

Pip

Re: IsUnitValid(id)

Posted: Thu Jan 08, 2015 5:08 pm
by enric
It's because I've an odd bug and thought it could come from this functions.
I loop on all units of a side
if (IsUnitValid(id)==0) // is loaded maybe?
{
transport = GetLoadedOn(id);
if (transport != -1)
{
distance = GetDistanceBetween(me, transport);
}

Probably I'm confused and the issue is in another place.