You know your "GroupRecycler" fails? Well here is the fix. Without it wc3 will crash if you make the MAX_GROUPS higher than 8192
Btw, this is a cheap rip off
Well, here is the fix
library GroupRecycler
globals
private constant integer MAX_GROUPS = 8191
private group array rG[MAX_GROUPS] // <- FIX!
private integer rN = 0
endglobals
function NewGroup takes nothing returns group
if (rN==0) then
set rG[0]=CreateGroup()
else
set rN=rN-1
endif
return rG[rN]
endfunction
function ReleaseGroup takes group g returns nothing
if(g == null) then
return
endif
if (rN == MAX_GROUPS) then
call DestroyGroup(g)
else
call GroupClear(g)
set rG[rN]=g
set rN=rN+1
endif
endfunction
endlibrary