#CTLD - InjectTroops - if precision coords is true, do also not randomize unit positions.

This commit is contained in:
Applevangelist 2025-01-12 17:03:18 +01:00
parent 30bedb39f1
commit def622a02c

View File

@ -1352,7 +1352,7 @@ CTLD.UnitTypeCapabilities = {
--- CTLD class version. --- CTLD class version.
-- @field #string version -- @field #string version
CTLD.version="1.1.22" CTLD.version="1.1.23"
--- Instantiate a new CTLD. --- Instantiate a new CTLD.
-- @param #CTLD self -- @param #CTLD self
@ -5583,11 +5583,12 @@ end
if PreciseLocation then if PreciseLocation then
randomcoord = zone:GetCoordinate():GetVec2() randomcoord = zone:GetCoordinate():GetVec2()
end end
local randompositions = not PreciseLocation
for _,_template in pairs(temptable) do for _,_template in pairs(temptable) do
self.TroopCounter = self.TroopCounter + 1 self.TroopCounter = self.TroopCounter + 1
local alias = string.format("%s-%d", _template, math.random(1,100000)) local alias = string.format("%s-%d", _template, math.random(1,100000))
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias) self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
:InitRandomizeUnits(true,20,2) :InitRandomizeUnits(randompositions,20,2)
:InitDelayOff() :InitDelayOff()
:SpawnFromVec2(randomcoord) :SpawnFromVec2(randomcoord)
if self.movetroopstowpzone and type ~= CTLD_CARGO.Enum.ENGINEERS then if self.movetroopstowpzone and type ~= CTLD_CARGO.Enum.ENGINEERS then