* added a check for zones; not added when zone does not exist
This commit is contained in:
Applevangelist 2022-10-18 17:23:01 +02:00
parent 3a6c52ae73
commit ff0f1c4c24

View File

@ -1074,7 +1074,7 @@ CTLD.UnitTypes = {
--- CTLD class version.
-- @field #string version
CTLD.version="1.0.15"
CTLD.version="1.0.16"
--- Instantiate a new CTLD.
-- @param #CTLD self
@ -3405,7 +3405,13 @@ end
-- @return #CTLD self
function CTLD:AddCTLDZone(Name, Type, Color, Active, HasBeacon, Shiplength, Shipwidth)
self:T(self.lid .. " AddCTLDZone")
local zone = ZONE:FindByName(Name)
if not zone then
self:E(self.lid.."**** Zone does not exist: "..Name)
return self
end
local ctldzone = {} -- #CTLD.CargoZone
ctldzone.active = Active or false
ctldzone.color = Color or SMOKECOLOR.Red