Skip to content

Commit

Permalink
Merge pull request #2188 from shaji-Dev/Heartbreaker
Browse files Browse the repository at this point in the history
Docs update PLAYERTASK:AddReconSuccessCondition
  • Loading branch information
Applevangelist authored Nov 11, 2024
2 parents 23080e3 + 1907353 commit fb2ba1d
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 fb2ba1d

Please sign in to comment.