From 376a3553fab4299149c3e27aa15cd5f46f24d9d0 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 30 Jun 2019 17:34:00 +0200 Subject: [PATCH] SPOT - Fixed bug in LaseOnCoordinate. - Minor stuff. --- .../Moose/AI/AI_A2A_Dispatcher.lua | 4 ++-- Moose Development/Moose/Core/Set.lua | 6 +++++- Moose Development/Moose/Core/Spot.lua | 19 ++++++++----------- .../Moose/Functional/Detection.lua | 2 +- .../Moose/Functional/Warehouse.lua | 2 +- Moose Development/Moose/Ops/Airboss.lua | 4 +++- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua index cd1836f6f..000327939 100644 --- a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua @@ -1617,7 +1617,7 @@ do -- AI_A2A_DISPATCHER --- Check if the Squadron is visible before startup of the dispatcher. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The squadron name. - -- @return #bool true if visible. + -- @return #boolean true if visible. -- @usage -- -- -- Set the Squadron visible before startup of dispatcher. @@ -2733,7 +2733,7 @@ do -- AI_A2A_DISPATCHER end - --- + --- Activate resource. -- @param #AI_A2A_DISPATCHER self function AI_A2A_DISPATCHER:ResourceActivate( DefenderSquadron, DefendersNeeded ) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index 20554631b..23b148ad3 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -558,6 +558,10 @@ do -- SET_BASE --- Iterate the SET_BASE and derived classes and call an iterator function for the given SET_BASE, providing the Object for each element within the set and optional parameters. -- @param #SET_BASE self -- @param #function IteratorFunction The function that will be called. + -- @param #table arg Arguments of the IteratorFunction. + -- @param #SET_BASE Set (Optional) The set to use. Default self:GetSet(). + -- @param #function Function (Optional) A function returning a #boolean true/false. Only if true, the IteratorFunction is called. + -- @param #table FunctionArguments (Optional) Function arguments. -- @return #SET_BASE self function SET_BASE:ForEach( IteratorFunction, arg, Set, Function, FunctionArguments ) self:F3( arg ) @@ -571,7 +575,7 @@ do -- SET_BASE local Object = ObjectData self:T3( Object ) if Function then - if Function( unpack( FunctionArguments ), Object ) == true then + if Function( unpack( FunctionArguments or {} ), Object ) == true then IteratorFunction( Object, unpack( arg ) ) end else diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua index 6395cd7b4..144c83ca3 100644 --- a/Moose Development/Moose/Core/Spot.lua +++ b/Moose Development/Moose/Core/Spot.lua @@ -285,11 +285,8 @@ do local RecceDcsUnit = self.Recce:GetDCSObject() - local aimat=Coordinate - aimat.y=aimat.y+1 - - self.SpotIR = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 2, z = 0 }, aimat:GetVec3() ) - self.SpotLaser = Spot.createLaser( RecceDcsUnit, { x = 0, y = 2, z = 0 }, aimat:GetVec3(), LaserCode ) + self.SpotIR = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 1, z = 0 }, Coordinate:GetVec3() ) + self.SpotLaser = Spot.createLaser( RecceDcsUnit, { x = 0, y = 1, z = 0 }, Coordinate:GetVec3(), LaserCode ) if Duration then self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration ) @@ -323,14 +320,14 @@ do self:__Lasing( -0.2 ) elseif self.TargetCoord then - local aimat=self.TargetCoord --Core.Point#COORDINATE - aimat.y=aimat.y+1+math.random(-100,100)/100 - aimat.x=aimat.x+math.random(-100,100)/100 + -- Wiggle the IR spot a bit. + local irvec3={x=self.TargetCoord.x+math.random(-100,100)/100, y=self.TargetCoord.y+math.random(-100,100)/100, z=self.TargetCoord.z} --#DCS.Vec3 + local lsvec3={x=self.TargetCoord.x, y=self.TargetCoord.y, z=self.TargetCoord.z} --#DCS.Vec3 - self.SpotIR:setPoint(aimat:GetVec3()) - self.SpotLaser:setPoint(self.TargetCoord:GetVec3()) + self.SpotIR:setPoint(irvec3) + self.SpotLaser:setPoint(lsvec3) - self:__Lasing( -0.2 ) + self:__Lasing(-0.25) else self:F( { "Target is not alive", self.Target:IsAlive() } ) end diff --git a/Moose Development/Moose/Functional/Detection.lua b/Moose Development/Moose/Functional/Detection.lua index d6f7c70fd..d57b1add6 100644 --- a/Moose Development/Moose/Functional/Detection.lua +++ b/Moose Development/Moose/Functional/Detection.lua @@ -1898,7 +1898,7 @@ do -- DETECTION_BASE --- Get the Detection Set. -- @param #DETECTION_BASE self - -- @return Core.Set#SET_BASE + -- @return #DETECTION_BASE self function DETECTION_BASE:GetDetectionSet() local DetectionSet = self.DetectionSet diff --git a/Moose Development/Moose/Functional/Warehouse.lua b/Moose Development/Moose/Functional/Warehouse.lua index 871da0168..527138506 100644 --- a/Moose Development/Moose/Functional/Warehouse.lua +++ b/Moose Development/Moose/Functional/Warehouse.lua @@ -4986,7 +4986,7 @@ function WAREHOUSE:onafterAirbaseRecaptured(From, Event, To, Coalition) end ---- On after "AssetDead" event triggerd when an asset group died. +--- On after "AssetDead" event triggered when an asset group died. -- @param #WAREHOUSE self -- @param #string From From state. -- @param #string Event Event. diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index 846ed502a..74b3778a3 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -12519,7 +12519,7 @@ end -- @param #number optdist Optimal distance in meters. -- @return #string Feedback message text. -- @return #string Debriefing text. --- @#AIRBOSS.RadioCall Distance radio call. Not implemented yet. +-- @return #AIRBOSS.RadioCall Distance radio call. Not implemented yet. function AIRBOSS:_DistanceCheck(playerData, optdist) if optdist==nil then @@ -12554,8 +12554,10 @@ function AIRBOSS:_DistanceCheck(playerData, optdist) hint=hint..string.format(" Optimal distance is %.1f NM.", UTILS.MetersToNM(optdist)) elseif playerData.difficulty==AIRBOSS.Difficulty.NORMAL then -- We keep it short normally. + hint="" elseif playerData.difficulty==AIRBOSS.Difficulty.HARD then -- No hint at all for the pros. + hint="" end -- Debriefing text.