- Joined
- Feb 11, 2011
- Messages
- 1,860
Hi guys,
I am wondering which is more efficient:
OR the method used in this example:
I am wondering which is more efficient:
JASS:
call ForGroup(group whichGroup, code callback)
JASS:
function Mass_Sleep takes nothing returns nothing
local group g
local unit u
local unit cast
local unit dumb
local location p
set cast = GetTriggerUnit()
set p = GetSpellTargetLoc()
set g = GetUnitsInRangeOfLocAll(800.00, p)
set u = FirstOfGroup(g)
loop
exitwhen u==null
set u = FirstOfGroup(g)
if IsUnitEnemy(u, GetOwningPlayer(cast))==true then
call GroupRemoveUnit(g,u)
set dumb = CreateUnitAtLoc(GetOwningPlayer(cast), ‘h000’, GetUnitLoc(u), 0.00)
call IssueTargetOrderBJ(dumb, “sleep”, u)
call UnitApplyTimedLifeBJ (1.50, ‘BTLF’, dumb)
set dumb = null
endif
endloop
set g = null
set u = null
set cast = null
set p = null
endfunction