Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Applevangelist committed Nov 17, 2024
2 parents ddcc20c + c27da8e commit 1b7dece
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Moose Development/Moose/Ops/PlayerTask.lua
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,15 @@ function PLAYERTASK:AddStaticObjectSuccessCondition()
end

--- [USER] Adds task success condition for AUFTRAG.Type.RECON when a client is at a certain LOS distance from the target.
-- @param #number maxDistance Minimum distance from client to target in LOS for success condition. (Default 5 NM)
-- @param #PLAYERTASK self
-- @param #number MinDistance Minimum distance in meters from client to target in LOS for success condition. (Default 5 NM)
-- @return #PLAYERTASK self
function PLAYERTASK:AddReconSuccessCondition(minDistance)
function PLAYERTASK:AddReconSuccessCondition(MinDistance)
local task = self
task:AddConditionSuccess(
function(target)
local targetLocation = target:GetCoordinate()
local minD = minDistance or UTILS.NMToMeters(5)
local minD = MinDistance or UTILS.NMToMeters(5)
for _, client in ipairs(task:GetClientObjects()) do
local clientCoord = client:GetCoordinate()
local distance = clientCoord:Get2DDistance(targetLocation)
Expand Down

0 comments on commit 1b7dece

Please sign in to comment.