mirror of
https://github.com/akaAgar/the-universal-mission-for-dcs-world.git
synced 2025-11-25 19:31:01 +00:00
Added getStaticObjectByID(), fixed bug in getSceneriesInZone()
This commit is contained in:
parent
948cdf325f
commit
5d022d3edf
@ -12,6 +12,7 @@
|
||||
-- DCSEx.world.getGroupByID(groupID)
|
||||
-- DCSEx.world.getNextMarkerID()
|
||||
-- DCSEx.world.getSceneriesInZone(center, radius, minHealth)
|
||||
-- DCSEx.world.getStaticObjectByID(staticID)
|
||||
-- DCSEx.world.getTerrainHeightDiff(coord, searchRadius)
|
||||
-- DCSEx.world.getUnitByID(unitID)
|
||||
-- DCSEx.world.isGroupAlive(g, unitsMustBeInAir)
|
||||
@ -342,7 +343,7 @@ do
|
||||
|
||||
local scenerySearchvolume = {
|
||||
id = world.VolumeType.SPHERE,
|
||||
params = { point = { x = center.x, y = 0, z = center.y }, radius = radius }
|
||||
params = { point = DCSEx.math.vec2ToVec3(center, "land"), radius = radius }
|
||||
}
|
||||
|
||||
local function ifSceneryFound(foundScenery, val)
|
||||
@ -360,6 +361,23 @@ do
|
||||
return sceneries
|
||||
end
|
||||
|
||||
-------------------------------------
|
||||
-- Searches and return a static object by its ID
|
||||
-- @param staticID ID of the static object
|
||||
-- @return An unit, or nil if no static object with this ID was found
|
||||
-------------------------------------
|
||||
function DCSEx.world.getStaticObjectByID(staticID)
|
||||
for coalitionID = 1, 2 do
|
||||
for _, s in pairs(coalition.getStaticObjects(coalitionID)) do
|
||||
if DCSEx.dcs.getObjectIDAsNumber(s) == staticID then
|
||||
return s
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
-- TODO: description, update file header
|
||||
function DCSEx.world.getTerrainHeightDiff(coord, searchRadius)
|
||||
local samples = {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user