Merge remote-tracking branch 'origin/develop' into branch

This commit is contained in:
Applevangelist 2025-01-30 09:06:11 +01:00
commit 2d49745215
2 changed files with 10 additions and 5 deletions

View File

@ -3814,15 +3814,20 @@ function RAT:Status(message, forID)
local N0units=group:GetInitialSize()
-- Monitor travelled distance since last check.
local Pnow=coords
local Dtravel=Pnow:Get2DDistance(ratcraft.Pnow)
ratcraft.Pnow=Pnow
local Dtravel=0
if coords and ratcraft.Pnow then
local Dtravel=coords:Get2DDistance(ratcraft.Pnow)
ratcraft.Pnow=coords
end
-- Add up the travelled distance.
ratcraft.Distance=ratcraft.Distance+Dtravel
-- Distance remaining to destination.
local Ddestination=Pnow:Get2DDistance(ratcraft.destination:GetCoordinate())
local Ddestination=-1
if ratcraft.Pnow then
Ddestination=ratcraft.Pnow:Get2DDistance(ratcraft.destination:GetCoordinate())
end
-- Status report.
if (forID and spawnindex==forID) or (not forID) then

View File

@ -21,7 +21,7 @@
-- ===
-- @module Ops.PlayerTask
-- @image OPS_PlayerTask.jpg
-- @date Last Update Nov 2024
-- @date Last Update Jan 2025
do