mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2026-07-16 14:25:10 +00:00
ctld.getNearbyUnits : sort by distance
This commit is contained in:
@@ -1989,7 +1989,7 @@ function ctld.getNearbyUnits(_point, _radius, _coalition)
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(unitsByDistance, function(a,b) return a.dist < b.dist end) -- sort the table by distance
|
||||
table.sort(unitsByDistance, function(a,b) return a.dist < b.dist end) -- sort the table by distance (the nearest first)
|
||||
for i, v in ipairs(unitsByDistance) do
|
||||
table.insert(_units, v.unit) -- insert nearby unitName
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user