This commit is contained in:
2025-05-25 23:39:34 +02:00
parent e1f392e8a3
commit 0d6809552d
5 changed files with 20 additions and 22 deletions
+3 -10
View File
@@ -622,16 +622,9 @@ do -- INIT DCS_UTIL
---destroy the given unit
---@param unitName string
function DCS_UTIL.DestroyUnit(unitName)
if DCS_UTIL.IsGroupStatic(unitName) == true then
local object = StaticObject.getByName(unitName)
if object ~= nil then
object:destroy()
end
else
local unit = Unit.getByName(unitName)
if unit and unit:isExist() then
unit:destroy()
end
local unit = Unit.getByName(unitName)
if unit and unit:isExist() then
unit:destroy()
end
end