mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-19 13:46:08 +00:00
Update Warehouse.lua
- fixes bug that descriptors are not obtained
This commit is contained in:
@@ -4097,7 +4097,7 @@ function WAREHOUSE:_RegisterAsset(group, ngroups, forceattribute, forcecargobay,
|
|||||||
-- Get name of template group.
|
-- Get name of template group.
|
||||||
local templategroupname=group:GetName()
|
local templategroupname=group:GetName()
|
||||||
local unit = group:GetUnit(1)
|
local unit = group:GetUnit(1)
|
||||||
local Descriptors= (unit and unit:IsAlive()) and unit:GetDesc() or {}
|
local Descriptors= (unit and unit:IsAlive()~=nil) and unit:GetDesc() or {}
|
||||||
local Category=group:GetCategory()
|
local Category=group:GetCategory()
|
||||||
local TypeName=group:GetTypeName() or "none"
|
local TypeName=group:GetTypeName() or "none"
|
||||||
local SpeedMax=group:GetSpeedMax()
|
local SpeedMax=group:GetSpeedMax()
|
||||||
@@ -4115,7 +4115,7 @@ function WAREHOUSE:_RegisterAsset(group, ngroups, forceattribute, forcecargobay,
|
|||||||
for _i,_unit in pairs(group:GetUnits()) do
|
for _i,_unit in pairs(group:GetUnits()) do
|
||||||
local unit=_unit --Wrapper.Unit#UNIT
|
local unit=_unit --Wrapper.Unit#UNIT
|
||||||
local Desc=unit:GetDesc()
|
local Desc=unit:GetDesc()
|
||||||
|
|
||||||
-- Weight. We sum up all units in the group.
|
-- Weight. We sum up all units in the group.
|
||||||
local unitweight=forceweight or Desc.massEmpty
|
local unitweight=forceweight or Desc.massEmpty
|
||||||
if unitweight then
|
if unitweight then
|
||||||
|
|||||||
Reference in New Issue
Block a user