mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-15 07:26:23 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
-- @module Ops.CTLD
|
-- @module Ops.CTLD
|
||||||
-- @image OPS_CTLD.jpg
|
-- @image OPS_CTLD.jpg
|
||||||
|
|
||||||
-- Last Update Oct 2025
|
-- Last Update Dec 2025
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -1513,7 +1513,7 @@ CTLD.FixedWingTypes = {
|
|||||||
|
|
||||||
--- CTLD class version.
|
--- CTLD class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CTLD.version="1.3.41"
|
CTLD.version="1.3.42"
|
||||||
|
|
||||||
--- Instantiate a new CTLD.
|
--- Instantiate a new CTLD.
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
@@ -1930,7 +1930,7 @@ function CTLD:New(Coalition, Prefixes, Alias)
|
|||||||
-- @param #string To State.
|
-- @param #string To State.
|
||||||
-- @param Wrapper.Group#GROUP Group Group Object.
|
-- @param Wrapper.Group#GROUP Group Group Object.
|
||||||
-- @param Wrapper.Unit#UNIT Unit Unit Object.
|
-- @param Wrapper.Unit#UNIT Unit Unit Object.
|
||||||
-- @param #CTLD_CARGO Cargo Cargo crate. Can be a Wrapper.DynamicCargo#DYNAMICCARGO object, if ground crew loaded!
|
-- @param #table Cargotable Table of #CTLD_CARGO cargo crates. Can be a Wrapper.DynamicCargo#DYNAMICCARGO objects, if ground crew loaded!
|
||||||
-- @return #CTLD self
|
-- @return #CTLD self
|
||||||
|
|
||||||
--- FSM Function OnAfterTroopsDeployed.
|
--- FSM Function OnAfterTroopsDeployed.
|
||||||
@@ -4118,16 +4118,16 @@ function CTLD:_ListCargo(Group, Unit)
|
|||||||
report:Add(" N O N E")
|
report:Add(" N O N E")
|
||||||
end
|
end
|
||||||
if hercInnerCount > 0 then
|
if hercInnerCount > 0 then
|
||||||
local hercMass = 0
|
local hercMass = 0
|
||||||
for _,_cargo in pairs(hercInnerCrates or {}) do
|
for _,_cargo in pairs(hercInnerCrates or {}) do
|
||||||
local cargo = _cargo
|
local cargo = _cargo
|
||||||
local type = cargo:GetType()
|
local type = cargo:GetType()
|
||||||
if type ~= CTLD_CARGO.Enum.TROOPS and type ~= CTLD_CARGO.Enum.ENGINEERS then
|
if type ~= CTLD_CARGO.Enum.TROOPS and type ~= CTLD_CARGO.Enum.ENGINEERS then
|
||||||
report:Add(string.format("Crate: %s size 1",cargo:GetName()))
|
report:Add(string.format("Crate: %s size 1",cargo:GetName()))
|
||||||
hercMass = hercMass + cargo:GetMass()
|
hercMass = hercMass + cargo:GetMass()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
loadedmass = loadedmass + hercMass
|
loadedmass = loadedmass + hercMass
|
||||||
end
|
end
|
||||||
--[[
|
--[[
|
||||||
if loadedno > 0 then
|
if loadedno > 0 then
|
||||||
@@ -8924,10 +8924,36 @@ end
|
|||||||
-- @return #CTLD self
|
-- @return #CTLD self
|
||||||
function CTLD:onbeforeCratesDropped(From, Event, To, Group, Unit, Cargotable)
|
function CTLD:onbeforeCratesDropped(From, Event, To, Group, Unit, Cargotable)
|
||||||
self:T({From, Event, To})
|
self:T({From, Event, To})
|
||||||
|
if Unit and Unit:IsPlayer() and self.PlayerTaskQueue then
|
||||||
|
local playername = Unit:GetPlayerName()
|
||||||
|
for _,_cargo in pairs(Cargotable) do
|
||||||
|
local Vehicle = _cargo.Positionable
|
||||||
|
if Vehicle then
|
||||||
|
local dropcoord = Vehicle:GetCoordinate() or COORDINATE:New(0,0,0)
|
||||||
|
local dropvec2 = dropcoord:GetVec2()
|
||||||
|
self.PlayerTaskQueue:ForEach(
|
||||||
|
function (Task)
|
||||||
|
local task = Task -- Ops.PlayerTask#PLAYERTASK
|
||||||
|
local subtype = task:GetSubType()
|
||||||
|
-- right subtype?
|
||||||
|
if Event == subtype and not task:IsDone() then
|
||||||
|
local targetzone = task.Target:GetObject() -- Core.Zone#ZONE should be a zone in this case ....
|
||||||
|
if targetzone and targetzone.ClassName and string.match(targetzone.ClassName,"ZONE") and targetzone:IsVec2InZone(dropvec2) then
|
||||||
|
if task.Clients:HasUniqueID(playername) then
|
||||||
|
-- success
|
||||||
|
task:__Success(-1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- (Internal) FSM Function onafterGetCrates.
|
--- (Internal) FSM Function OnAfterGetCrates.
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
-- @param #string From State.
|
-- @param #string From State.
|
||||||
-- @param #string Event Trigger.
|
-- @param #string Event Trigger.
|
||||||
@@ -8936,12 +8962,12 @@ end
|
|||||||
-- @param Wrapper.Unit#UNIT Unit Unit Object.
|
-- @param Wrapper.Unit#UNIT Unit Unit Object.
|
||||||
-- @param #table Cargotable Table of #CTLD_CARGO objects spawned via "Get".
|
-- @param #table Cargotable Table of #CTLD_CARGO objects spawned via "Get".
|
||||||
-- @return #CTLD self
|
-- @return #CTLD self
|
||||||
function CTLD:onaftergetcrates(From, Event, To, Group, Unit, Cargotable)
|
function CTLD:OnAfterGetCrates(From, Event, To, Group, Unit, Cargotable)
|
||||||
self:T({From, Event, To})
|
self:T({From, Event, To})
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- (Internal) FSM Function onafterGetCrates.
|
--- (Internal) FSM Function OnAfterRemoveCratesNearby.
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
-- @param #string From State.
|
-- @param #string From State.
|
||||||
-- @param #string Event Trigger.
|
-- @param #string Event Trigger.
|
||||||
@@ -8950,7 +8976,7 @@ end
|
|||||||
-- @param Wrapper.Unit#UNIT Unit Unit Object.
|
-- @param Wrapper.Unit#UNIT Unit Unit Object.
|
||||||
-- @param #table Cargotable Table of #CTLD_CARGO objects spawned via "Get".
|
-- @param #table Cargotable Table of #CTLD_CARGO objects spawned via "Get".
|
||||||
-- @return #CTLD self
|
-- @return #CTLD self
|
||||||
function CTLD:onafterremovecratesnearby(From, Event, To, Group, Unit, Cargotable)
|
function CTLD:OnAfterRemoveCratesNearby(From, Event, To, Group, Unit, Cargotable)
|
||||||
self:T({From, Event, To})
|
self:T({From, Event, To})
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user