diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua index 4e17118f5..488816a9d 100644 --- a/Moose Development/Moose/Core/Spot.lua +++ b/Moose Development/Moose/Core/Spot.lua @@ -5,7 +5,8 @@ -- SPOT implements the DCS Spot class functionality, but adds additional luxury to be able to: -- -- * Spot for a defined duration. --- * wiggle the spot at the target. +-- * Updates of laer spot position every 0.2 seconds for moving targets. +-- * Wiggle the spot at the target. -- * Provide a @{Wrapper.Unit} as a target, instead of a point. -- * Implement a status machine, LaseOn, LaseOff. -- @@ -49,7 +50,8 @@ do --- Implements the target spotting or marking functionality, but adds additional luxury to be able to: -- -- * Mark targets for a defined duration. - -- * wiggle the spot at the target. + -- * Updates of laer spot position every 0.2 seconds for moving targets. + -- * Wiggle the spot at the target. -- * Provide a @{Wrapper.Unit} as a target, instead of a point. -- * Implement a status machine, LaseOn, LaseOff. -- @@ -85,9 +87,7 @@ do --- SPOT Constructor. -- @param #SPOT self - -- @param Wrapper.Unit#UNIT Recce - -- @param #number LaserCode - -- @param #number Duration + -- @param Wrapper.Unit#UNIT Recce Unit that is lasing -- @return #SPOT function SPOT:New( Recce ) @@ -115,12 +115,17 @@ do --- LaseOn Trigger for SPOT -- @function [parent=#SPOT] LaseOn -- @param #SPOT self + -- @param Wrapper.Positionable#POSITIONABLE Target + -- @param #number LaserCode Laser code. + -- @param #number Duration Duration of lasing in seconds. --- LaseOn Asynchronous Trigger for SPOT -- @function [parent=#SPOT] __LaseOn -- @param #SPOT self -- @param #number Delay - + -- @param Wrapper.Positionable#POSITIONABLE Target + -- @param #number LaserCode Laser code. + -- @param #number Duration Duration of lasing in seconds. self:AddTransition( "On", "Lasing", "On" ) @@ -193,9 +198,9 @@ do -- @param From -- @param Event -- @param To - -- @param Wrapper.Positionable#POSITIONABLE Target - -- @param #number LaserCode - -- @param #number Duration + -- @param Wrapper.Positionable#POSITIONABLE Target Unit that is being lased. + -- @param #number LaserCode Laser code. + -- @param #number Duration Duration of lasing in seconds. function SPOT:onafterLaseOn( From, Event, To, Target, LaserCode, Duration ) self:F( { "LaseOn", Target, LaserCode, Duration } ) diff --git a/Moose Development/Moose/Functional/Warehouse.lua b/Moose Development/Moose/Functional/Warehouse.lua index c07b5bad3..6ce654ad5 100644 --- a/Moose Development/Moose/Functional/Warehouse.lua +++ b/Moose Development/Moose/Functional/Warehouse.lua @@ -1536,7 +1536,7 @@ WAREHOUSE.db = { --- Warehouse class version. -- @field #string version -WAREHOUSE.version="0.5.7" +WAREHOUSE.version="0.5.8" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO: Warehouse todo list. @@ -5795,7 +5795,6 @@ function WAREHOUSE:_CheckRequestNow(request) -- Check if number of requested assets is in stock. local _assets,_nassets,_enough=self:_FilterStock(self.stock, request.assetdesc, request.assetdescval, request.nasset, onlymobile) - local _transports -- Check if enough assets are in stock. if not _enough then @@ -5805,13 +5804,17 @@ function WAREHOUSE:_CheckRequestNow(request) self:T(self.wid..text) return false end - + + local _transports + local _assetattribute + local _assetcategory + -- Check if at least one (cargo) asset is available. if _nassets>0 then -- Get the attibute of the requested asset. - local _assetattribute=_assets[1].attribute - local _assetcategory=_assets[1].category + _assetattribute=_assets[1].attribute + _assetcategory=_assets[1].category -- Check available parking for air asset units. if self.airbase and (_assetcategory==Group.Category.AIRPLANE or _assetcategory==Group.Category.HELICOPTER) then @@ -5870,16 +5873,22 @@ function WAREHOUSE:_CheckRequestNow(request) -- Self propelled case. Nothing to do for now. - --local dist=self.spawnzone:GetCoordinate():Get2DDistance(self:GetCoordinate()) - local dist=self.warehouse:GetCoordinate():Get2DDistance(request.warehouse.spawnzone:GetCoordinate()) - - if dist>5000 then - -- Not enough or the right transport carriers. - local text=string.format("Warehouse %s: Request denied! Not close enough to spawn zone. Distance = %d m", self.alias, dist) - self:_InfoMessage(text, 5) - return false + -- Ground asset checks. + if _assetcategory==Group.Category.GROUND then + + -- Distance between warehouse and spawn zone. + local dist=self.warehouse:GetCoordinate():Get2DDistance(request.warehouse.spawnzone:GetCoordinate()) + + -- Check min dist to spawn zone. + if dist>5000 then + -- Not close enough to spawn zone. + local text=string.format("Warehouse %s: Request denied! Not close enough to spawn zone. Distance = %d m. We need to be at least within 5000 m range to spawn.", self.alias, dist) + self:_InfoMessage(text, 5) + return false + end + end - + end