CTLD - small extra nil check in _GetUnitCargoMass(Unit

This commit is contained in:
Applevangelist 2022-03-03 12:34:55 +01:00
parent b0c2bad1d8
commit f3d0d55a2f

View File

@ -2263,6 +2263,7 @@ end
-- @return #number mass in kgs
function CTLD:_GetUnitCargoMass(Unit)
self:T(self.lid .. " _GetUnitCargoMass")
if not Unit then return 0 end
local unitname = Unit:GetName()
local loadedcargo = self.Loaded_Cargo[unitname] or {} -- #CTLD.LoadedCargo
local loadedmass = 0 -- #number