This gives me a fatal error, and I can't figure out why.
Code:
function IsBad takes nothing returns boolean
return ( IsPlayerEnemy(GetFilterPlayer(), ConvertedPlayer(udg_Numb[1])) == true )
endfunction
function Attack takes nothing returns nothing
call IssuePointOrderLocBJ( GetEnumUnit(), "attack", udg_Point )
call DisplayTextToForce( GetPlayersAll(), ":O" )
endfunction
function Noworkers takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) != 'uaco' )
endfunction
function Trig_LaunchAttacks_Actions takes nothing returns nothing
local location array l
local integer i = GetRandomInt(1, 5)
local integer start = 1
local integer end = 12
local boolean stop
local integer count = 0
call DisplayTextToForce( GetPlayersAll(), ":O" )
set l[1] = GetPlayerStartLocationLoc(Player(0))
set l[2] = GetPlayerStartLocationLoc(Player(3))
set l[3] = GetPlayerStartLocationLoc(Player(6))
set l[4] = GetPlayerStartLocationLoc(Player(9))
set l[5] = GetRectCenter(gg_rct_Region_001)
loop
exitwhen start > end
set udg_Spawns[start] = GetUnitsOfPlayerMatching(ConvertedPlayer(start), Condition(function Noworkers))
loop
set udg_Numb[1] = start
call DisplayTextToForce( GetPlayersAll(), I2S(CountUnitsInGroup(GetUnitsInRangeOfLocMatching(655.0, l[i], Condition(function IsBad)))))
if CountUnitsInGroup(GetUnitsInRangeOfLocMatching(655.0, l[i], Condition(function IsBad))) == 0 then
set i = GetRandomInt(1, 5)
set stop = false
call DisplayTextToForce( GetPlayersAll(), I2S(udg_Numb[1]))
else
call DisplayTextToForce( GetPlayersAll(), "Yes!" )
set stop = true
endif
exitwhen stop == true
set start = start + 1
endloop
set udg_Point = l[i]
call ForGroupBJ( udg_Spawns[start], function Attack )
call DisplayTextToForce( GetPlayersAll(), ":O" )
endloop
endfunction
//===========================================================================
function InitTrig_LaunchAttacks takes nothing returns nothing
set gg_trg_LaunchAttacks = CreateTrigger( )
call TriggerAddAction( gg_trg_LaunchAttacks, function Trig_LaunchAttacks_Actions )
endfunction