mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-23 11:40:57 +00:00
Merge branch 'develop' into FF/Fox2
This commit is contained in:
@@ -4751,6 +4751,28 @@ function WAREHOUSE:onbeforeArrived(From, Event, To, group)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- On before "Arrived" event. Triggered when a group has arrived at its destination warehouse.
|
||||||
|
-- @param #WAREHOUSE self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
-- @param Wrapper.Group#GROUP group The group that was delivered.
|
||||||
|
function WAREHOUSE:onbeforeArrived(From, Event, To, group)
|
||||||
|
|
||||||
|
local asset=self:FindAssetInDB(group)
|
||||||
|
|
||||||
|
if asset then
|
||||||
|
if asset.arrived==true then
|
||||||
|
-- Asset already arrived (e.g. if multiple units trigger the event via landing).
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
asset.arrived=true --ensure this is not called again from the same asset group.
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--- On after "Arrived" event. Triggered when a group has arrived at its destination warehouse.
|
--- On after "Arrived" event. Triggered when a group has arrived at its destination warehouse.
|
||||||
-- The routine should be called by the warehouse sending this asset and not by the receiving warehouse.
|
-- The routine should be called by the warehouse sending this asset and not by the receiving warehouse.
|
||||||
-- It is checked if this asset is cargo (or self propelled) or transport. If it is cargo it is put into the stock of receiving warehouse.
|
-- It is checked if this asset is cargo (or self propelled) or transport. If it is cargo it is put into the stock of receiving warehouse.
|
||||||
|
|||||||
Reference in New Issue
Block a user