Wc3C.net

Wc3C.net (http://www.wc3c.net/forums.php)
-   Scripts (http://www.wc3c.net/forumdisplay.php?f=737)
-   -   AbilityPreload (http://www.wc3c.net/showthread.php?t=105279)

Bribe 08-30-2010 01:16 PM

Collapse JASS:
function AbilityRangePreload takes integer start, integer end returns nothing
    local integer i = 1
        if start > end then
            set i = -1
        endif
        loop
            exitwhen start > end
            call UnitAddAbility(PreloadUnit, start)
            set start = start + i
        endloop
endfunction

I don't know what you intended to do with that integer i, but in its current state this whole function should just retain the loop alone and yet do the exact same thing;

Collapse JASS:
function AbilityRangePreload takes integer start, integer end returns nothing
    loop
        exitwhen start > end
        call UnitAddAbility(PreloadUnit, start)
        set start = start + 1
    endloop
endfunction

Perhaps you meant to do this?:

Collapse JASS:
function AbilityRangePreload takes integer start, integer end returns nothing
    local integer i = 1
    if (start > end) then
        set i = -1
    endif
    loop
        call UnitAddAbility(PreloadUnit, start)
        exitwhen start == end
        set start = start + i
    endloop
endfunction


All times are GMT. The time now is 12:37 AM.

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services