the idea is a system that create struct by unit, add the unit to a unit group, and in another function, pick every unit in the group and take members of the struct that have the unit as a member
aff, all am i do is bugged? ¬¬ i guess yes,
i'll see and reply
EDIT
i finish, now, bug free XD (i hope ¬¬)
EDIT²
a dont know how to add lucoust to a unit by trigger :/
so, ¬¬, i dont know what do :/
EDIT:
i really dont see other leaks, but, however, try in the jass function, set the unit to null in the final, and if still so many leaks, try destroy the location every use, and set it again
maybe your code have group leaks, put a custon script: "set bj_wantDestroyGroup= true" before every group using and say to me if it worked.
And in you jass code, put "exit when Number < -1"
because the number code of the player 1 is 0
i have a question, if be this:
Set TempPoint = (Center of Region)
Custom script: call RemoveLocation (udg_TempPoint)
Set TempPoint = (Center of OtherRegion)
Custom script: call RemoveLocation (udg_TempPoint)