**INTEL**
- Added nil check for cluster position update

**OPSGROUP**
- Improved fire at point task to take only max avail shots and relative shot amount
- Fixed tasks not executed after teleport
This commit is contained in:
Frank
2022-05-03 09:41:22 +02:00
committed by GitHub
parent 68dce2f247
commit d2d431ce2e
7 changed files with 341 additions and 164 deletions

View File

@@ -4144,8 +4144,18 @@ function OPSGROUP:onafterTaskExecute(From, Event, To, Task)
-- Debug info.
self:T(self.lid..string.format("Fire at point with nshots=%d of %d", nShots, nAmmo))
-- Only fire number of avail shots.
nShots=math.min(nShots, nAmmo)
if nShots==-1 then
-- The -1 is for using all available ammo.
nShots=nAmmo
self:T(self.lid..string.format("Fire at point taking max amount of ammo = %d", nShots))
elseif nShots<1 then
local p=nShots
nShots=UTILS.Round(p*nAmmo, 0)
self:T(self.lid..string.format("Fire at point taking %.1f percent amount of ammo = %d", p, nShots))
else
-- Fire nShots but at most nAmmo.
nShots=math.min(nShots, nAmmo)
end
-- Set quantity of task.
DCSTask.params.expendQty=nShots