mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
OPSTRANSPORT
Fixed loaded not correctly checked in OPSGROUP
This commit is contained in:
parent
725efc3e70
commit
0c376aec63
@ -2930,6 +2930,14 @@ end
|
||||
-- @param #string CarrierGroupName (Optional) Additionally check if group is loaded into a particular carrier group(s).
|
||||
-- @return #boolean If true, group is loaded.
|
||||
function OPSGROUP:IsLoaded(CarrierGroupName)
|
||||
|
||||
local isloaded=self.cargoStatus==OPSGROUP.CargoStatus.LOADED
|
||||
|
||||
-- If not loaded, we can return false
|
||||
if not isloaded then
|
||||
return false
|
||||
end
|
||||
|
||||
if CarrierGroupName then
|
||||
if type(CarrierGroupName)~="table" then
|
||||
CarrierGroupName={CarrierGroupName}
|
||||
@ -2937,12 +2945,14 @@ function OPSGROUP:IsLoaded(CarrierGroupName)
|
||||
for _,CarrierName in pairs(CarrierGroupName) do
|
||||
local carrierGroup=self:_GetMyCarrierGroup()
|
||||
if carrierGroup and carrierGroup.groupname==CarrierName then
|
||||
return true
|
||||
return isloaded
|
||||
end
|
||||
end
|
||||
-- Not in any specified carrier.
|
||||
return false
|
||||
end
|
||||
return self.cargoStatus==OPSGROUP.CargoStatus.LOADED
|
||||
|
||||
return isloaded
|
||||
end
|
||||
|
||||
--- Check if the group is currently busy doing something.
|
||||
@ -10058,7 +10068,6 @@ function OPSGROUP:onafterBoard(From, Event, To, CarrierGroup, Carrier)
|
||||
|
||||
-- Trigger Load event.
|
||||
CarrierGroup:Load(self)
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
@ -10069,7 +10078,6 @@ function OPSGROUP:onafterBoard(From, Event, To, CarrierGroup, Carrier)
|
||||
|
||||
-- Set carrier. As long as the group is not loaded, we only reserve the cargo space.�
|
||||
CarrierGroup:_AddCargobay(self, Carrier, true)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user