Was wondering if PolledWaits are any good with stopping a map from desyncing
IE: I want the trigger to wait a second before taking an action.
Sample code below, would a polled wait be sufficient in not desyncing the game? Or do I need to implement a timer?
IE: I want the trigger to wait a second before taking an action.
Sample code below, would a polled wait be sufficient in not desyncing the game? Or do I need to implement a timer?
JASS:
function MCA takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local unit z = GetSpellTargetUnit()
local integer i = GetUnitAbilityLevel(u, 'A01P')
local real x = GetUnitX(z)
local real y = GetUnitY(z)
call TriggerSleepAction(1)
loop
exitwhen i == 0
set u = CreateUnit(p,'nmrl',x,y,0)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl",u,"overhead"))
call IssueTargetOrder(u,"attack",z)
set i = i-1
endloop
set z = null
set u = null
set p = null
endfunction