fix CTLD:ActivateZone not processing default correctly and using wrong zone table (#1575)

This commit is contained in:
bbirchnz 2021-07-19 15:16:21 +10:00 committed by GitHub
parent 96d1d3cb66
commit 6690f70b05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1840,15 +1840,15 @@ function CTLD:ActivateZone(Name,ZoneType,NewState)
self:T(self.lid .. " AddZone") self:T(self.lid .. " AddZone")
local newstate = true local newstate = true
-- set optional in case we\'re deactivating -- set optional in case we\'re deactivating
if not NewState or NewState == false then if NewState ~= nil then
newstate = false newstate = NewState
end end
-- get correct table -- get correct table
local zone = ZoneType -- #CTLD.CargoZone
local table = {} local table = {}
if zone.type == CTLD.CargoZoneType.LOAD then if ZoneType == CTLD.CargoZoneType.LOAD then
table = self.pickupZones table = self.pickupZones
elseif zone.type == CTLD.CargoZoneType.DROP then elseif ZoneType == CTLD.CargoZoneType.DROP then
table = self.dropOffZones table = self.dropOffZones
else else
table = self.wpZones table = self.wpZones
@ -1864,6 +1864,7 @@ function CTLD:ActivateZone(Name,ZoneType,NewState)
return self return self
end end
--- User function - Deactivate Name #CTLD.CargoZoneType ZoneType for this CTLD instance. --- User function - Deactivate Name #CTLD.CargoZoneType ZoneType for this CTLD instance.
-- @param #CTLD self -- @param #CTLD self
-- @param #string Name Name of the zone to change in the ME. -- @param #string Name Name of the zone to change in the ME.