mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Revert "Ops - Various"
This reverts commit 23ea5d9d0676a9775a19e0aec0afb07e15e67e8f.
This commit is contained in:
parent
9082054ba9
commit
d42bdb2505
@ -1626,7 +1626,6 @@ WAREHOUSE = {
|
|||||||
-- @field #string spawngroupname Name of the spawned group.
|
-- @field #string spawngroupname Name of the spawned group.
|
||||||
-- @field #boolean iscargo If true, asset is cargo. If false asset is transport. Nil if in stock.
|
-- @field #boolean iscargo If true, asset is cargo. If false asset is transport. Nil if in stock.
|
||||||
-- @field #boolean arrived If true, asset arrived at its destination.
|
-- @field #boolean arrived If true, asset arrived at its destination.
|
||||||
-- @field Core.Point#COORDINATE spawncoordinate If set, spawn asst here and not in the designated spawn zone.
|
|
||||||
--
|
--
|
||||||
-- @field #number damage Damage of asset group in percent.
|
-- @field #number damage Damage of asset group in percent.
|
||||||
-- @field Ops.AirWing#AIRWING.Payload payload The payload of the asset.
|
-- @field Ops.AirWing#AIRWING.Payload payload The payload of the asset.
|
||||||
@ -1796,7 +1795,7 @@ _WAREHOUSEDB = {
|
|||||||
|
|
||||||
--- Warehouse class version.
|
--- Warehouse class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
WAREHOUSE.version="1.0.3"
|
WAREHOUSE.version="1.0.2"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO: Warehouse todo list.
|
-- TODO: Warehouse todo list.
|
||||||
@ -4250,11 +4249,9 @@ end
|
|||||||
-- @param #number nTransport Number of transport units requested.
|
-- @param #number nTransport Number of transport units requested.
|
||||||
-- @param #number Prio Priority of the request. Number ranging from 1=high to 100=low.
|
-- @param #number Prio Priority of the request. Number ranging from 1=high to 100=low.
|
||||||
-- @param #string Assignment A keyword or text that later be used to identify this request and postprocess the assets.
|
-- @param #string Assignment A keyword or text that later be used to identify this request and postprocess the assets.
|
||||||
-- @param Core.Point#COORDINATE SpawnCoordinate Spawn group here instead of the SpawnZone.
|
|
||||||
-- @return #boolean If true, request is okay at first glance.
|
-- @return #boolean If true, request is okay at first glance.
|
||||||
function WAREHOUSE:onbeforeAddRequest(From, Event, To, warehouse, AssetDescriptor, AssetDescriptorValue, nAsset, TransportType, nTransport, Assignment, Prio, SpawnCoordinate)
|
function WAREHOUSE:onbeforeAddRequest(From, Event, To, warehouse, AssetDescriptor, AssetDescriptorValue, nAsset, TransportType, nTransport, Assignment, Prio)
|
||||||
-- self:I({From, Event, To})
|
|
||||||
--self:I({SpawnCoordinate=SpawnCoordinate})
|
|
||||||
-- Request is okay.
|
-- Request is okay.
|
||||||
local okay=true
|
local okay=true
|
||||||
|
|
||||||
@ -4347,10 +4344,8 @@ end
|
|||||||
-- @param #number nTransport Number of transport units requested.
|
-- @param #number nTransport Number of transport units requested.
|
||||||
-- @param #number Prio Priority of the request. Number ranging from 1=high to 100=low.
|
-- @param #number Prio Priority of the request. Number ranging from 1=high to 100=low.
|
||||||
-- @param #string Assignment A keyword or text that can later be used to identify this request and postprocess the assets.
|
-- @param #string Assignment A keyword or text that can later be used to identify this request and postprocess the assets.
|
||||||
-- @param Core.Point#COORDINATE SpawnCoordinate Spawn group here instead of the SpawnZone.
|
function WAREHOUSE:onafterAddRequest(From, Event, To, warehouse, AssetDescriptor, AssetDescriptorValue, nAsset, TransportType, nTransport, Prio, Assignment)
|
||||||
function WAREHOUSE:onafterAddRequest(From, Event, To, warehouse, AssetDescriptor, AssetDescriptorValue, nAsset, TransportType, nTransport, Prio, Assignment, SpawnCoordinate)
|
|
||||||
--self:I({From, Event, To})
|
|
||||||
--self:I({SpawnCoordinate=SpawnCoordinate})
|
|
||||||
-- Defaults.
|
-- Defaults.
|
||||||
nAsset=nAsset or 1
|
nAsset=nAsset or 1
|
||||||
TransportType=TransportType or WAREHOUSE.TransportType.SELFPROPELLED
|
TransportType=TransportType or WAREHOUSE.TransportType.SELFPROPELLED
|
||||||
@ -4389,7 +4384,6 @@ function WAREHOUSE:onafterAddRequest(From, Event, To, warehouse, AssetDescriptor
|
|||||||
ntransporthome=0,
|
ntransporthome=0,
|
||||||
assets={},
|
assets={},
|
||||||
toself=toself,
|
toself=toself,
|
||||||
spawncoordinate=SpawnCoordinate,
|
|
||||||
} --#WAREHOUSE.Queueitem
|
} --#WAREHOUSE.Queueitem
|
||||||
|
|
||||||
-- Add request to queue.
|
-- Add request to queue.
|
||||||
@ -5820,8 +5814,7 @@ end
|
|||||||
-- @param #boolean lateactivated If true, groups are spawned late activated.
|
-- @param #boolean lateactivated If true, groups are spawned late activated.
|
||||||
-- @return Wrapper.Group#GROUP The spawned group or nil if the group could not be spawned.
|
-- @return Wrapper.Group#GROUP The spawned group or nil if the group could not be spawned.
|
||||||
function WAREHOUSE:_SpawnAssetGroundNaval(alias, asset, request, spawnzone, lateactivated)
|
function WAREHOUSE:_SpawnAssetGroundNaval(alias, asset, request, spawnzone, lateactivated)
|
||||||
--self:I("_SpawnAssetGroundNaval - " .. tostring(asset.templatename))
|
|
||||||
--self:I({coordinate = request.spawncoordinate})
|
|
||||||
if asset and (asset.category==Group.Category.GROUND or asset.category==Group.Category.SHIP or asset.category==Group.Category.TRAIN) then
|
if asset and (asset.category==Group.Category.GROUND or asset.category==Group.Category.SHIP or asset.category==Group.Category.TRAIN) then
|
||||||
|
|
||||||
-- Prepare spawn template.
|
-- Prepare spawn template.
|
||||||
@ -5833,11 +5826,6 @@ function WAREHOUSE:_SpawnAssetGroundNaval(alias, asset, request, spawnzone, late
|
|||||||
-- Get a random coordinate in the spawn zone.
|
-- Get a random coordinate in the spawn zone.
|
||||||
local coord=spawnzone:GetRandomCoordinate()
|
local coord=spawnzone:GetRandomCoordinate()
|
||||||
|
|
||||||
-- Is a specific coordinate set?
|
|
||||||
if request.spawncoordinate then
|
|
||||||
coord = request.spawncoordinate
|
|
||||||
end
|
|
||||||
|
|
||||||
-- For trains, we use the rail connection point.
|
-- For trains, we use the rail connection point.
|
||||||
if asset.category==Group.Category.TRAIN then
|
if asset.category==Group.Category.TRAIN then
|
||||||
coord=self.rail
|
coord=self.rail
|
||||||
@ -7654,7 +7642,7 @@ end
|
|||||||
-- @param #WAREHOUSE self
|
-- @param #WAREHOUSE self
|
||||||
-- @return #WAREHOUSE.Queueitem Chosen request.
|
-- @return #WAREHOUSE.Queueitem Chosen request.
|
||||||
function WAREHOUSE:_CheckQueue()
|
function WAREHOUSE:_CheckQueue()
|
||||||
--self:T("_CheckQueue()")
|
|
||||||
-- Sort queue wrt to first prio and then qid.
|
-- Sort queue wrt to first prio and then qid.
|
||||||
self:_SortQueue()
|
self:_SortQueue()
|
||||||
|
|
||||||
@ -7692,13 +7680,7 @@ function WAREHOUSE:_CheckQueue()
|
|||||||
self:_DeleteQueueItem(_request, self.queue)
|
self:_DeleteQueueItem(_request, self.queue)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ Execute request.
|
-- Execute request.
|
||||||
if request and type(request) == "table" then
|
|
||||||
for _key,_value in pairs(request) do
|
|
||||||
self:I("Key = ".. tostring(_key))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--]]
|
|
||||||
return request
|
return request
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -162,8 +162,6 @@
|
|||||||
-- @field #number optionRTBfuel RTB on out-of-fuel.
|
-- @field #number optionRTBfuel RTB on out-of-fuel.
|
||||||
-- @field #number optionECM ECM.
|
-- @field #number optionECM ECM.
|
||||||
--
|
--
|
||||||
-- @field Core.Point#COORDINATE specialCoordinate Special point to reload Brigade units in place.
|
|
||||||
--
|
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- *A warrior's mission is to foster the success of others.* - Morihei Ueshiba
|
--- *A warrior's mission is to foster the success of others.* - Morihei Ueshiba
|
||||||
|
|||||||
@ -324,7 +324,7 @@ function LEGION:AddMission(Mission)
|
|||||||
|
|
||||||
-- Set target for ALERT 5.
|
-- Set target for ALERT 5.
|
||||||
if Mission.type==AUFTRAG.Type.ALERT5 then
|
if Mission.type==AUFTRAG.Type.ALERT5 then
|
||||||
--Mission:_TargetFromObject(self:GetCoordinate())
|
Mission:_TargetFromObject(self:GetCoordinate())
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add mission to queue.
|
-- Add mission to queue.
|
||||||
@ -694,10 +694,6 @@ function LEGION:onafterMissionRequest(From, Event, To, Mission)
|
|||||||
asset.flightgroup:MissionCancel(currM)
|
asset.flightgroup:MissionCancel(currM)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Cancel the current mission.
|
|
||||||
if currM and currM.type==AUFTRAG.Type.ONGUARD then
|
|
||||||
asset.flightgroup:MissionCancel(currM)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Trigger event.
|
-- Trigger event.
|
||||||
self:__OpsOnMission(5, asset.flightgroup, Mission)
|
self:__OpsOnMission(5, asset.flightgroup, Mission)
|
||||||
@ -725,23 +721,18 @@ function LEGION:onafterMissionRequest(From, Event, To, Mission)
|
|||||||
asset.requested=true
|
asset.requested=true
|
||||||
asset.isReserved=false
|
asset.isReserved=false
|
||||||
|
|
||||||
-- Set mission task so that the group is spawned with the right one.
|
-- Set missin task so that the group is spawned with the right one.
|
||||||
if Mission.missionTask then
|
if Mission.missionTask then
|
||||||
asset.missionTask=Mission.missionTask
|
asset.missionTask=Mission.missionTask
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local coordinate = nil
|
|
||||||
if Mission.specialCoordinate then
|
|
||||||
coordinate = Mission.specialCoordinate
|
|
||||||
end
|
|
||||||
|
|
||||||
-- TODO: Get/set functions for assignment string.
|
-- TODO: Get/set functions for assignment string.
|
||||||
local assignment=string.format("Mission-%d", Mission.auftragsnummer)
|
local assignment=string.format("Mission-%d", Mission.auftragsnummer)
|
||||||
|
|
||||||
-- Add request to legion warehouse.
|
-- Add request to legion warehouse.
|
||||||
self:AddRequest(self, WAREHOUSE.Descriptor.ASSETLIST, Assetlist, #Assetlist, nil, nil, Mission.prio, assignment, coordinate)
|
self:AddRequest(self, WAREHOUSE.Descriptor.ASSETLIST, Assetlist, #Assetlist, nil, nil, Mission.prio, assignment)
|
||||||
|
|
||||||
-- The queueid has been increased in the onafterAddRequest function. So we can simply use it here.
|
-- The queueid has been increased in the onafterAddRequest function. So we can simply use it here.
|
||||||
Mission.requestID[self.alias]=self.queueid
|
Mission.requestID[self.alias]=self.queueid
|
||||||
|
|||||||
@ -2159,7 +2159,7 @@ function UTILS.LoadSetOfGroups(Path,Filename,Spawn)
|
|||||||
local posz = tonumber(dataset[6])
|
local posz = tonumber(dataset[6])
|
||||||
local coordinate = COORDINATE:NewFromVec3({x=posx, y=posy, z=posz})
|
local coordinate = COORDINATE:NewFromVec3({x=posx, y=posy, z=posz})
|
||||||
local group=nil
|
local group=nil
|
||||||
local data = { groupname=groupname, template=template, size=size, coordinate=coordinate }
|
local data = { groupname=groupname, size=size, coordinate=coordinate }
|
||||||
table.insert(datatable,data)
|
table.insert(datatable,data)
|
||||||
if spawn then
|
if spawn then
|
||||||
local group = SPAWN:New(groupname)
|
local group = SPAWN:New(groupname)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user