mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop' into FF/Develop
This commit is contained in:
commit
6b7a778eac
@ -424,7 +424,7 @@ function AI_CARGO_APC:onbeforeLoad( APC, From, Event, To )
|
|||||||
for _, Cargo in pairs( self.CargoSet:GetSet() ) do
|
for _, Cargo in pairs( self.CargoSet:GetSet() ) do
|
||||||
local Cargo = Cargo -- Cargo.Cargo#CARGO
|
local Cargo = Cargo -- Cargo.Cargo#CARGO
|
||||||
self:F( { IsUnLoaded = Cargo:IsUnLoaded(), IsDeployed = Cargo:IsDeployed(), Cargo:GetName(), APC:GetName() } )
|
self:F( { IsUnLoaded = Cargo:IsUnLoaded(), IsDeployed = Cargo:IsDeployed(), Cargo:GetName(), APC:GetName() } )
|
||||||
if Cargo:IsUnLoaded() and not Cargo:IsDeployed() then
|
if Cargo:IsUnLoaded() then -- and not Cargo:IsDeployed() then
|
||||||
if Cargo:IsInLoadRadius( APCUnit:GetCoordinate() ) then
|
if Cargo:IsInLoadRadius( APCUnit:GetCoordinate() ) then
|
||||||
self:F( { "In radius", APCUnit:GetName() } )
|
self:F( { "In radius", APCUnit:GetName() } )
|
||||||
|
|
||||||
@ -552,7 +552,6 @@ function AI_CARGO_APC:onafterUnload( APC, From, Event, To, Deployed )
|
|||||||
for _, Cargo in pairs( APCUnit:GetCargo() ) do
|
for _, Cargo in pairs( APCUnit:GetCargo() ) do
|
||||||
if Cargo:IsLoaded() then
|
if Cargo:IsLoaded() then
|
||||||
Cargo:UnBoard()
|
Cargo:UnBoard()
|
||||||
Cargo:SetDeployed( true )
|
|
||||||
self:__Unboard( 10, Cargo, Deployed )
|
self:__Unboard( 10, Cargo, Deployed )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -581,7 +580,6 @@ function AI_CARGO_APC:onafterUnboard( APC, From, Event, To, Cargo, Deployed )
|
|||||||
for _, Cargo in pairs( APCUnit:GetCargo() ) do
|
for _, Cargo in pairs( APCUnit:GetCargo() ) do
|
||||||
if Cargo:IsLoaded() then
|
if Cargo:IsLoaded() then
|
||||||
Cargo:UnBoard()
|
Cargo:UnBoard()
|
||||||
Cargo:SetDeployed( true )
|
|
||||||
self:__Unboard( 10, Cargo, Deployed )
|
self:__Unboard( 10, Cargo, Deployed )
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -606,6 +604,7 @@ function AI_CARGO_APC:onbeforeUnloaded( APC, From, Event, To, Cargo, Deployed )
|
|||||||
self:F( { APC, From, Event, To, Cargo:GetName(), Deployed = Deployed } )
|
self:F( { APC, From, Event, To, Cargo:GetName(), Deployed = Deployed } )
|
||||||
|
|
||||||
local AllUnloaded = true
|
local AllUnloaded = true
|
||||||
|
Cargo:SetDeployed( true )
|
||||||
|
|
||||||
--Cargo:Regroup()
|
--Cargo:Regroup()
|
||||||
|
|
||||||
|
|||||||
@ -239,7 +239,7 @@ do -- CARGO_UNIT
|
|||||||
if not self.CargoInAir then
|
if not self.CargoInAir then
|
||||||
-- If NearRadius is given, then use the given NearRadius, otherwise calculate the NearRadius
|
-- If NearRadius is given, then use the given NearRadius, otherwise calculate the NearRadius
|
||||||
-- based upon the Carrier bounding radius, which is calculated from the bounding rectangle on the Y axis.
|
-- based upon the Carrier bounding radius, which is calculated from the bounding rectangle on the Y axis.
|
||||||
local NearRadius = CargoCarrier:GetBoundingRadius( NearRadius )
|
local NearRadius = CargoCarrier:GetBoundingRadius( NearRadius ) + 5
|
||||||
if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then
|
if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then
|
||||||
self:Load( CargoCarrier, NearRadius, ... )
|
self:Load( CargoCarrier, NearRadius, ... )
|
||||||
else
|
else
|
||||||
|
|||||||
@ -643,14 +643,14 @@ function ZONE_RADIUS:Scan( ObjectCategories )
|
|||||||
local CoalitionDCSUnit = ZoneObject:getCoalition()
|
local CoalitionDCSUnit = ZoneObject:getCoalition()
|
||||||
self.ScanData.Coalitions[CoalitionDCSUnit] = true
|
self.ScanData.Coalitions[CoalitionDCSUnit] = true
|
||||||
self.ScanData.Units[ZoneObject] = ZoneObject
|
self.ScanData.Units[ZoneObject] = ZoneObject
|
||||||
self:F( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } )
|
self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } )
|
||||||
end
|
end
|
||||||
if ObjectCategory == Object.Category.SCENERY then
|
if ObjectCategory == Object.Category.SCENERY then
|
||||||
local SceneryType = ZoneObject:getTypeName()
|
local SceneryType = ZoneObject:getTypeName()
|
||||||
local SceneryName = ZoneObject:getName()
|
local SceneryName = ZoneObject:getName()
|
||||||
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
||||||
self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( SceneryName, ZoneObject )
|
self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( SceneryName, ZoneObject )
|
||||||
self:F( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } )
|
self:F2( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
@ -1174,6 +1174,7 @@ function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius )
|
|||||||
self:F( { ZoneName, ZoneGROUP:GetVec2(), Radius } )
|
self:F( { ZoneName, ZoneGROUP:GetVec2(), Radius } )
|
||||||
|
|
||||||
self._.ZoneGROUP = ZoneGROUP
|
self._.ZoneGROUP = ZoneGROUP
|
||||||
|
self._.ZoneVec2Cache = self._.ZoneGROUP:GetVec2()
|
||||||
|
|
||||||
-- Zone objects are added to the _DATABASE and SET_ZONE objects.
|
-- Zone objects are added to the _DATABASE and SET_ZONE objects.
|
||||||
_EVENTDISPATCHER:CreateEventNewZone( self )
|
_EVENTDISPATCHER:CreateEventNewZone( self )
|
||||||
@ -1188,7 +1189,14 @@ end
|
|||||||
function ZONE_GROUP:GetVec2()
|
function ZONE_GROUP:GetVec2()
|
||||||
self:F( self.ZoneName )
|
self:F( self.ZoneName )
|
||||||
|
|
||||||
local ZoneVec2 = self._.ZoneGROUP:GetVec2()
|
local ZoneVec2 = nil
|
||||||
|
|
||||||
|
if self._.ZoneGROUP:IsAlive() then
|
||||||
|
ZoneVec2 = self._.ZoneGROUP:GetVec2()
|
||||||
|
self._.ZoneVec2Cache = ZoneVec2
|
||||||
|
else
|
||||||
|
ZoneVec2 = self._.ZoneVec2Cache
|
||||||
|
end
|
||||||
|
|
||||||
self:T( { ZoneVec2 } )
|
self:T( { ZoneVec2 } )
|
||||||
|
|
||||||
|
|||||||
@ -279,7 +279,7 @@ function POSITIONABLE:GetBoundingRadius()
|
|||||||
local Z = Box.max.z - Box.min.z
|
local Z = Box.max.z - Box.min.z
|
||||||
local CX = X / 2
|
local CX = X / 2
|
||||||
local CZ = Z / 2
|
local CZ = Z / 2
|
||||||
return math.max( CX, CZ ) + 3
|
return math.max( CX, CZ )
|
||||||
end
|
end
|
||||||
|
|
||||||
BASE:E( { "Cannot GetBoundingRadius", Positionable = self, Alive = self:IsAlive() } )
|
BASE:E( { "Cannot GetBoundingRadius", Positionable = self, Alive = self:IsAlive() } )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user