Fearoth
New Member
- Reaction score
- 1
Is it possible, if so is it safe to use callbacks inside loops where the loop keeps owerwriting the group which is used by the callback? Like;
'h005' being my helper for locking player cameras - Each player gets one in the beginning.
JASS:
function A2 takes nothing returns nothing
local unit a = GetEnumUnit()
local player b = GetOwningPlayer(a)
if GetUnitTypeId(a)==039;h005039; then
call SetCameraTargetControllerNoZForPlayer(b,a,0,0,false)
endif
endfunction
function A1 takes nothing returns nothing
local integer a = 0
local group b = null
loop
exitwhen a == 7
set b = GetUnitsInRectOfPlayer(GetPlayableMapRect(),Player(a))
call ForGroup(b,function A2)
set b = null
set a = a + 1
endloop
call DestroyGroup(b)
endfunction
'h005' being my helper for locking player cameras - Each player gets one in the beginning.