Update CTLD.lua

Fix an issue when a ship is used as loading zone and the ship is destroyed
This commit is contained in:
Thomas 2025-04-28 09:20:04 +02:00 committed by GitHub
parent 3ad60a95ce
commit b145588ed5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5662,6 +5662,7 @@ function CTLD:IsUnitInZone(Unit,Zonetype)
if Zonetype == CTLD.CargoZoneType.SHIP then if Zonetype == CTLD.CargoZoneType.SHIP then
self:T("Checking Type Ship: "..zonename) self:T("Checking Type Ship: "..zonename)
local ZoneUNIT = UNIT:FindByName(zonename) local ZoneUNIT = UNIT:FindByName(zonename)
if not ZoneUNIT then return false end
zonecoord = ZoneUNIT:GetCoordinate() zonecoord = ZoneUNIT:GetCoordinate()
zoneradius = czone.shiplength zoneradius = czone.shiplength
zonewidth = czone.shipwidth zonewidth = czone.shipwidth