mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-18 13:16:03 +00:00
CTLD - small fix for finding crates when using engineers
This commit is contained in:
@@ -1021,7 +1021,7 @@ CTLD.UnitTypes = {
|
|||||||
|
|
||||||
--- CTLD class version.
|
--- CTLD class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CTLD.version="1.0.9"
|
CTLD.version="1.0.10"
|
||||||
|
|
||||||
--- Instantiate a new CTLD.
|
--- Instantiate a new CTLD.
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
@@ -2095,11 +2095,18 @@ function CTLD:_FindCratesNearby( _group, _unit, _dist, _ignoreweight)
|
|||||||
-- cycle
|
-- cycle
|
||||||
local index = 0
|
local index = 0
|
||||||
local found = {}
|
local found = {}
|
||||||
local loadedmass = self:_GetUnitCargoMass(_unit)
|
local loadedmass = 0
|
||||||
local unittype = _unit:GetTypeName()
|
local unittype = "none"
|
||||||
local capabilities = self:_GetUnitCapabilities(_unit) -- #CTLD.UnitCapabilities
|
local capabilities = {}
|
||||||
local maxmass = capabilities.cargoweightlimit
|
local maxmass = 2000
|
||||||
local maxloadable = maxmass - loadedmass
|
local maxloadable = 2000
|
||||||
|
if not _ignoreweight then
|
||||||
|
loadedmass = self:_GetUnitCargoMass(_unit)
|
||||||
|
unittype = _unit:GetTypeName()
|
||||||
|
capabilities = self:_GetUnitCapabilities(_unit) -- #CTLD.UnitCapabilities
|
||||||
|
maxmass = capabilities.cargoweightlimit
|
||||||
|
maxloadable = maxmass - loadedmass
|
||||||
|
end
|
||||||
self:T(self.lid .. " Max loadable mass: " .. maxloadable)
|
self:T(self.lid .. " Max loadable mass: " .. maxloadable)
|
||||||
for _,_cargoobject in pairs (existingcrates) do
|
for _,_cargoobject in pairs (existingcrates) do
|
||||||
local cargo = _cargoobject -- #CTLD_CARGO
|
local cargo = _cargoobject -- #CTLD_CARGO
|
||||||
|
|||||||
Reference in New Issue
Block a user