If the first unit of this group was removed from the game (RemoveUnit or decayed) then null be returned, regardless if there're valid units in group at further indeces. To iterate over all existing units of a group, use
ForGroupBJ. You cannot remove such null "holes" from a group without destroying or clearing it (
GroupClear). If you use FirstOfGroup in iterations with removal, units in the group will eventually leak.
Returns the unit at the first position in group or null if that unit no longer exists.
See GroupUtils Library for vJass.
- return type
- Source code
native FirstOfGroup takes group whichGroup returns unit