mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Docs update for:
PLAYERTASK:AddReconSuccessCondition
This commit is contained in:
parent
b50d3fa809
commit
19073534dd
@ -500,14 +500,15 @@ function PLAYERTASK:AddStaticObjectSuccessCondition()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- [USER] Adds task success condition for AUFTRAG.Type.RECON when a client is at a certain LOS distance from the target.
|
--- [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
|
-- @return #PLAYERTASK self
|
||||||
function PLAYERTASK:AddReconSuccessCondition(minDistance)
|
function PLAYERTASK:AddReconSuccessCondition(MinDistance)
|
||||||
local task = self
|
local task = self
|
||||||
task:AddConditionSuccess(
|
task:AddConditionSuccess(
|
||||||
function(target)
|
function(target)
|
||||||
local targetLocation = target:GetCoordinate()
|
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
|
for _, client in ipairs(task:GetClientObjects()) do
|
||||||
local clientCoord = client:GetCoordinate()
|
local clientCoord = client:GetCoordinate()
|
||||||
local distance = clientCoord:Get2DDistance(targetLocation)
|
local distance = clientCoord:Get2DDistance(targetLocation)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user