LastOfGroup
not ratedthis acts same as FirstOfGroup with the difference that this one returns the last unit of the given gruop.
function LastOfGroup takes group g returns unit
local unit u
local group y=g
if CountUnitsInGroup(y)<1 then
return FirstOfGroup(y) //actually now will return a null if the group is empty or something similiar..
endif
loop
exitwhen CountUnitsInGroup(y)==1
set u=FirstOfGroup(y)
call GroupRemoveUnit(y,u)
endloop
set u=FirstOfGroup(y)
call DestroyGroup(y)
set y=null
return u
endfunctionNo comments.