MeleeFindNearestMine

Parameters
src location
range real
comment
bug

Leaks handle nearbyMines: In Jass you must set local variables that hold agents (or any child type) to null at the end of functions to avoid reference counter leaks.

patch

1.00

Source
Blizzard.j
return type
unit
Source code
function MeleeFindNearestMine takes location src, real range returns unit
    local group nearbyMines

    set bj_meleeNearestMine = null
    set bj_meleeNearestMineDist = -1
    set bj_meleeNearestMineToLoc = src

    set nearbyMines = CreateGroup()
    call GroupEnumUnitsInRangeOfLoc(nearbyMines, src, range, null)
    call ForGroup(nearbyMines, function MeleeEnumFindNearestMine)
    call DestroyGroup(nearbyMines)

    return bj_meleeNearestMine
endfunction