Jass:MeleeEnumFindNearestMine – Mappedia

Jass:MeleeEnumFindNearestMine

Aus Mappedia
Wechseln zu: Navigation, Suche
Funktion: MeleeEnumFindNearestMine
Parameter: nothing
Rückgabewert: nothing
Autor: Blizzard
Quelle: Blizzard.j
Synchron: Unbekannt



Code

function MeleeEnumFindNearestMine takes nothing returns nothing
    local unit enumUnit = GetEnumUnit()
    local real dist
    local location unitLoc

    if (GetUnitTypeId(enumUnit) == 'ngol') then
        set unitLoc = GetUnitLoc(enumUnit)
        set dist = DistanceBetweenPoints(unitLoc, bj_meleeNearestMineToLoc)
        call RemoveLocation(unitLoc)

        // If this is our first mine, or the closest thusfar, use it instead.
        if (bj_meleeNearestMineDist < 0) or (dist < bj_meleeNearestMineDist) then
            set bj_meleeNearestMine = enumUnit
            set bj_meleeNearestMineDist = dist
        endif
    endif
endfunction
Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
Warcraft-Mapping
Werkzeuge