@jtff/miztemplate-lib 3.8.13 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- env.info('*** MOOSE GITHUB Commit Hash ID: 2025-08-14T17:17:34+02:00-b9cf1e46afcee679aa09b480d3451864da72a5e3 ***')
1
+ env.info('*** MOOSE GITHUB Commit Hash ID: 2025-09-11T05:13:50+02:00-cda1432d048f5a8946e42833f7f560db16f57248 ***')
2
2
  if not MOOSE_DEVELOPMENT_FOLDER then
3
3
  MOOSE_DEVELOPMENT_FOLDER='Scripts'
4
4
  end
@@ -2189,7 +2189,7 @@ local delta=UTILS.VecAngle(v1,v2)
2189
2189
  return math.abs(delta)
2190
2190
  end
2191
2191
  function UTILS.HdgTo(a,b)
2192
- local dz=b.z-a.z
2192
+ local dz=(b.z or b.y)-(a.z or a.y)
2193
2193
  local dx=b.x-a.x
2194
2194
  local heading=math.deg(math.atan2(dz,dx))
2195
2195
  if heading<0 then
@@ -4288,6 +4288,135 @@ qx=qx+shift_factor*norm_dx
4288
4288
  qy=qy+shift_factor*norm_dy
4289
4289
  return{x=qx,y=qy}
4290
4290
  end
4291
+ function UTILS.ValidateAndRepositionGroundUnits(Positions,Anchor,MaxRadius,Spacing)
4292
+ local units=Positions
4293
+ Anchor=Anchor or UTILS.GetCenterPoint(units)
4294
+ local gPos={x=Anchor.x,y=Anchor.z or Anchor.y}
4295
+ local maxRadius=0
4296
+ local unitCount=0
4297
+ for _,unit in pairs(units)do
4298
+ local pos={x=unit.x,y=unit.z or unit.y}
4299
+ local dist=UTILS.VecDist2D(pos,gPos)
4300
+ if dist>maxRadius then
4301
+ maxRadius=dist
4302
+ end
4303
+ unitCount=unitCount+1
4304
+ end
4305
+ maxRadius=MaxRadius or math.max(maxRadius*2,10)
4306
+ local spacing=Spacing or math.max(maxRadius*0.05,5)
4307
+ if unitCount>0 and maxRadius>5 then
4308
+ local spots=UTILS.GetSimpleZones(UTILS.Vec2toVec3(gPos),maxRadius,spacing,1000)
4309
+ if spots and#spots>0 then
4310
+ local validSpots={}
4311
+ for _,spot in pairs(spots)do
4312
+ if land.getSurfaceType(spot)==land.SurfaceType.LAND then
4313
+ table.insert(validSpots,spot)
4314
+ end
4315
+ end
4316
+ spots=validSpots
4317
+ end
4318
+ local step=spacing
4319
+ for _,unit in pairs(units)do
4320
+ local pos={x=unit.x,y=unit.z or unit.y}
4321
+ local isOnLand=land.getSurfaceType(pos)==land.SurfaceType.LAND
4322
+ local isValid=false
4323
+ if spots and#spots>0 then
4324
+ local si=1
4325
+ local sid=0
4326
+ local closestDist=100000000
4327
+ local closestSpot
4328
+ for _,spot in pairs(spots)do
4329
+ local dist=UTILS.VecDist2D(pos,spot)
4330
+ if dist<closestDist then
4331
+ closestDist=dist
4332
+ closestSpot=spot
4333
+ sid=si
4334
+ end
4335
+ si=si+1
4336
+ end
4337
+ if closestSpot then
4338
+ if closestDist>=spacing then
4339
+ pos=closestSpot
4340
+ end
4341
+ isValid=true
4342
+ table.remove(spots,sid)
4343
+ end
4344
+ end
4345
+ if not isValid and not isOnLand then
4346
+ local h=UTILS.HdgTo(pos,gPos)
4347
+ local retries=0
4348
+ while not isValid and retries<500 do
4349
+ local dist=UTILS.VecDist2D(pos,gPos)
4350
+ pos=UTILS.Vec2Translate(pos,step,h)
4351
+ local skip=false
4352
+ for _,unit2 in pairs(units)do
4353
+ if unit~=unit2 then
4354
+ local pos2={x=unit2.x,y=unit2.z or unit2.y}
4355
+ local dist2=UTILS.VecDist2D(pos,pos2)
4356
+ if dist2<12 then
4357
+ isValid=false
4358
+ skip=true
4359
+ break
4360
+ end
4361
+ end
4362
+ end
4363
+ if not skip and dist>step and land.getSurfaceType(pos)==land.SurfaceType.LAND then
4364
+ isValid=true
4365
+ break
4366
+ elseif dist<=step then
4367
+ break
4368
+ end
4369
+ retries=retries+1
4370
+ end
4371
+ end
4372
+ if isValid then
4373
+ unit.x=pos.x
4374
+ if unit.z then
4375
+ unit.z=pos.y
4376
+ else
4377
+ unit.y=pos.y
4378
+ end
4379
+ end
4380
+ end
4381
+ end
4382
+ end
4383
+ function UTILS.ValidateAndRepositionStatic(Country,Category,Type,Position,ShapeName,MaxRadius)
4384
+ local coord=COORDINATE:NewFromVec2(Position)
4385
+ local st=SPAWNSTATIC:NewFromType(Type,Category,Country)
4386
+ if ShapeName then
4387
+ st:InitShape(ShapeName)
4388
+ end
4389
+ local sName="s-"..timer.getTime().."-"..math.random(1,10000)
4390
+ local tempStatic=st:SpawnFromCoordinate(coord,0,sName)
4391
+ if tempStatic then
4392
+ local sRadius=tempStatic:GetBoundingRadius(2)or 3
4393
+ tempStatic:Destroy()
4394
+ sRadius=sRadius*0.5
4395
+ MaxRadius=MaxRadius or math.max(sRadius*10,100)
4396
+ local positions=UTILS.GetSimpleZones(coord:GetVec3(),MaxRadius,sRadius,20)
4397
+ if positions and#positions>0 then
4398
+ local closestSpot
4399
+ local closestDist=math.huge
4400
+ for _,spot in pairs(positions)do
4401
+ if land.getSurfaceType(spot)==land.SurfaceType.LAND then
4402
+ local dist=UTILS.VecDist2D(Position,spot)
4403
+ if dist<closestDist then
4404
+ closestDist=dist
4405
+ closestSpot=spot
4406
+ end
4407
+ end
4408
+ end
4409
+ if closestSpot then
4410
+ if closestDist>=sRadius then
4411
+ return closestSpot
4412
+ else
4413
+ return Position
4414
+ end
4415
+ end
4416
+ end
4417
+ end
4418
+ return nil
4419
+ end
4291
4420
  PROFILER={
4292
4421
  ClassName="PROFILER",
4293
4422
  Counters={},
@@ -19737,6 +19866,12 @@ self.SpawnUnitsWithAbsolutePositions=true
19737
19866
  self.UnitsAbsolutePositions=Positions
19738
19867
  return self
19739
19868
  end
19869
+ function SPAWN:InitValidateAndRepositionGroundUnits(OnOff,MaxRadius,Spacing)
19870
+ self.SpawnValidateAndRepositionGroundUnits=OnOff
19871
+ self.SpawnValidateAndRepositionGroundUnitsRadius=MaxRadius
19872
+ self.SpawnValidateAndRepositionGroundUnitsSpacing=Spacing
19873
+ return self
19874
+ end
19740
19875
  function SPAWN:InitRandomizeTemplate(SpawnTemplatePrefixTable)
19741
19876
  local temptable={}
19742
19877
  for _,_temp in pairs(SpawnTemplatePrefixTable)do
@@ -20106,6 +20241,11 @@ end
20106
20241
  if self.SpawnHiddenOnMap then
20107
20242
  SpawnTemplate.hidden=self.SpawnHiddenOnMap
20108
20243
  end
20244
+ if self.SpawnValidateAndRepositionGroundUnits then
20245
+ local units=SpawnTemplate.units
20246
+ local gPos={x=SpawnTemplate.x,y=SpawnTemplate.y}
20247
+ UTILS.ValidateAndRepositionGroundUnits(units,gPos,self.SpawnValidateAndRepositionGroundUnitsRadius,self.SpawnValidateAndRepositionGroundUnitsSpacing)
20248
+ end
20109
20249
  SpawnTemplate.CategoryID=self.SpawnInitCategory or SpawnTemplate.CategoryID
20110
20250
  SpawnTemplate.CountryID=self.SpawnInitCountry or SpawnTemplate.CountryID
20111
20251
  SpawnTemplate.CoalitionID=self.SpawnInitCoalition or SpawnTemplate.CoalitionID
@@ -21426,6 +21566,11 @@ self.InitOffsetY=OffsetY or 0
21426
21566
  self.InitOffsetAngle=OffsetAngle or 0
21427
21567
  return self
21428
21568
  end
21569
+ function SPAWNSTATIC:InitValidateAndRepositionStatic(OnOff,MaxRadius)
21570
+ self.ValidateAndRepositionStatic=OnOff
21571
+ self.ValidateAndRepositionStaticMaxRadius=MaxRadius
21572
+ return self
21573
+ end
21429
21574
  function SPAWNSTATIC:OnSpawnStatic(SpawnCallBackFunction,...)
21430
21575
  self:F("OnSpawnStatic")
21431
21576
  self.SpawnFunctionHook=SpawnCallBackFunction
@@ -21512,6 +21657,13 @@ end
21512
21657
  self.SpawnIndex=self.SpawnIndex+1
21513
21658
  Template.name=self.InitStaticName or string.format("%s#%05d",self.SpawnTemplatePrefix,self.SpawnIndex)
21514
21659
  local Static=nil
21660
+ if self.ValidateAndRepositionStatic then
21661
+ local validPos=UTILS.ValidateAndRepositionStatic(CountryID,Template.category,Template.type,Template,Template.shape_name,self.ValidateAndRepositionStaticMaxRadius)
21662
+ if validPos then
21663
+ Template.x=validPos.x
21664
+ Template.y=validPos.y
21665
+ end
21666
+ end
21515
21667
  if self.InitFarp then
21516
21668
  local TemplateGroup={}
21517
21669
  TemplateGroup.units={}
@@ -26744,6 +26896,7 @@ GROUND_EWR="Ground_EWR",
26744
26896
  GROUND_AAA="Ground_AAA",
26745
26897
  GROUND_SAM="Ground_SAM",
26746
26898
  GROUND_SHORAD="Ground_SHORAD",
26899
+ GROUND_BALLISTICMISSILE="Ground_BallisticMissile",
26747
26900
  GROUND_OTHER="Ground_OtherGround",
26748
26901
  NAVAL_AIRCRAFTCARRIER="Naval_AircraftCarrier",
26749
26902
  NAVAL_WARSHIP="Naval_WarShip",
@@ -27794,6 +27947,9 @@ if self.InitRespawnModu then
27794
27947
  Template.modulation=self.InitRespawnModu
27795
27948
  end
27796
27949
  self:Destroy(false)
27950
+ if self.ValidateAndRepositionGroundUnits then
27951
+ UTILS.ValidateAndRepositionGroundUnits(Template.units)
27952
+ end
27797
27953
  self:ScheduleOnce(0.1,_DATABASE.Spawn,_DATABASE,Template)
27798
27954
  self:ResetEvents()
27799
27955
  return self
@@ -27998,6 +28154,8 @@ local infantry=self:HasAttribute("Infantry")
27998
28154
  local artillery=self:HasAttribute("Artillery")
27999
28155
  local tank=self:HasAttribute("Old Tanks")or self:HasAttribute("Modern Tanks")or self:HasAttribute("Tanks")
28000
28156
  local aaa=self:HasAttribute("AAA")and(not self:HasAttribute("SAM elements"))
28157
+ local ballisticMissile=artillery and self:HasAttribute("SS_missile")
28158
+ local shorad=self:HasAttribute("SR SAM")
28001
28159
  local ewr=self:HasAttribute("EWR")
28002
28160
  local ifv=self:HasAttribute("IFV")
28003
28161
  local sam=self:HasAttribute("SAM elements")or self:HasAttribute("Optical Tracker")
@@ -28028,6 +28186,8 @@ elseif sam then
28028
28186
  attribute=GROUP.Attribute.GROUND_SAM
28029
28187
  elseif aaa then
28030
28188
  attribute=GROUP.Attribute.GROUND_AAA
28189
+ elseif artillery and ballisticMissile then
28190
+ attribute=GROUP.Attribute.GROUND_BALLISTICMISSILE
28031
28191
  elseif artillery then
28032
28192
  attribute=GROUP.Attribute.GROUND_ARTILLERY
28033
28193
  elseif tank then
@@ -28307,6 +28467,44 @@ end
28307
28467
  end
28308
28468
  return isAAA
28309
28469
  end
28470
+ function GROUP:SetValidateAndRepositionGroundUnits(Enabled)
28471
+ self.ValidateAndRepositionGroundUnits=Enabled
28472
+ end
28473
+ function GROUP:GetBoundingBox()
28474
+ local bbox={min={x=math.huge,y=math.huge,z=math.huge},
28475
+ max={x=-math.huge,y=-math.huge,z=-math.huge}
28476
+ }
28477
+ local Units=self:GetUnits()or{}
28478
+ if#Units==0 then
28479
+ return nil
28480
+ end
28481
+ for _,unit in pairs(Units)do
28482
+ if unit and unit:IsAlive()then
28483
+ local ubox=unit:GetBoundingBox()
28484
+ if ubox then
28485
+ if ubox.min.x<bbox.min.x then
28486
+ bbox.min.x=ubox.min.x
28487
+ end
28488
+ if ubox.min.y<bbox.min.y then
28489
+ bbox.min.y=ubox.min.y
28490
+ end
28491
+ if ubox.min.z<bbox.min.z then
28492
+ bbox.min.z=ubox.min.z
28493
+ end
28494
+ if ubox.max.x>bbox.max.x then
28495
+ bbox.max.x=ubox.max.x
28496
+ end
28497
+ if ubox.max.y>bbox.max.y then
28498
+ bbox.max.y=ubox.max.y
28499
+ end
28500
+ if ubox.max.z>bbox.max.z then
28501
+ bbox.max.z=ubox.max.z
28502
+ end
28503
+ end
28504
+ end
28505
+ end
28506
+ return bbox
28507
+ end
28310
28508
  UNIT={
28311
28509
  ClassName="UNIT",
28312
28510
  UnitName=nil,
@@ -28444,6 +28642,9 @@ i=i+1
28444
28642
  end
28445
28643
  end
28446
28644
  SpawnGroupTemplate.groupId=nil
28645
+ if self.ValidateAndRepositionGroundUnits then
28646
+ UTILS.ValidateAndRepositionGroundUnits(SpawnGroupTemplate.units)
28647
+ end
28447
28648
  _DATABASE:Spawn(SpawnGroupTemplate)
28448
28649
  end
28449
28650
  function UNIT:IsActive()
@@ -29227,6 +29428,9 @@ end
29227
29428
  function UNIT:SetCarrierIlluminationMode(Mode)
29228
29429
  UTILS.SetCarrierIlluminationMode(self:GetID(),Mode)
29229
29430
  end
29431
+ function UNIT:SetValidateAndRepositionGroundUnits(Enabled)
29432
+ self.ValidateAndRepositionGroundUnits=Enabled
29433
+ end
29230
29434
  CLIENT={
29231
29435
  ClassName="CLIENT",
29232
29436
  ClientName=nil,
@@ -29991,6 +30195,7 @@ AIRBASE.Sinai={
29991
30195
  ["Borg_El_Arab_International_Airport"]="Borg El Arab International Airport",
29992
30196
  ["Cairo_International_Airport"]="Cairo International Airport",
29993
30197
  ["Cairo_West"]="Cairo West",
30198
+ ["Damascus_Intl"]="Damascus Intl",
29994
30199
  ["Difarsuwar_Airfield"]="Difarsuwar Airfield",
29995
30200
  ["El_Arish"]="El Arish",
29996
30201
  ["El_Gora"]="El Gora",
@@ -50813,6 +51018,9 @@ self:I(self.lid..text)
50813
51018
  self:T({DCSdesc=asset.DCSdesc})
50814
51019
  self:T3({Template=asset.template})
50815
51020
  end
51021
+ function WAREHOUSE:SetValidateAndRepositionGroundUnits(Enabled)
51022
+ self.ValidateAndRepositionGroundUnits=Enabled
51023
+ end
50816
51024
  function WAREHOUSE:onafterNewAsset(From,Event,To,asset,assignment)
50817
51025
  self:T(self.lid..string.format("New asset %s id=%d with assignment %s.",tostring(asset.templatename),asset.uid,tostring(assignment)))
50818
51026
  end
@@ -51628,6 +51836,9 @@ template.route.points[1].y=coord.z
51628
51836
  template.x=coord.x
51629
51837
  template.y=coord.z
51630
51838
  template.alt=coord.y
51839
+ if self.ValidateAndRepositionGroundUnits then
51840
+ UTILS.ValidateAndRepositionGroundUnits(template.units)
51841
+ end
51631
51842
  local group=_DATABASE:Spawn(template)
51632
51843
  return group
51633
51844
  end
@@ -56559,8 +56770,12 @@ WASHINGTON="CVN_73",
56559
56770
  TRUMAN="CVN_75",
56560
56771
  STENNIS="Stennis",
56561
56772
  FORRESTAL="Forrestal",
56773
+ ENTERPRISE66="USS Enterprise 1966",
56774
+ ENTERPRISEMODERN="cvn-65",
56562
56775
  VINSON="VINSON",
56563
56776
  ESSEX="Essex",
56777
+ BONHOMMERICHARD="USS Bon Homme Richard",
56778
+ ESSEXSCB125="essex_scb125",
56564
56779
  HERMES="HERMES81",
56565
56780
  INVINCIBLE="hms_invincible",
56566
56781
  TARAWA="LHA_Tarawa",
@@ -56618,7 +56833,7 @@ HARD="TOPGUN Graduate",
56618
56833
  }
56619
56834
  AIRBOSS.MenuF10={}
56620
56835
  AIRBOSS.MenuF10Root=nil
56621
- AIRBOSS.version="1.4.1"
56836
+ AIRBOSS.version="1.4.2"
56622
56837
  function AIRBOSS:New(carriername,alias)
56623
56838
  local self=BASE:Inherit(self,FSM:New())
56624
56839
  self:F2({carriername=carriername,alias=alias})
@@ -56697,10 +56912,18 @@ elseif self.carriertype==AIRBOSS.CarrierType.TRUMAN then
56697
56912
  self:_InitNimitz()
56698
56913
  elseif self.carriertype==AIRBOSS.CarrierType.FORRESTAL then
56699
56914
  self:_InitForrestal()
56915
+ elseif self.carriertype==AIRBOSS.CarrierType.ENTERPRISE66 then
56916
+ self:_InitEnterprise()
56917
+ elseif self.carriertype==AIRBOSS.CarrierType.ENTERPRISEMODERN then
56918
+ self:_InitEnterprise()
56700
56919
  elseif self.carriertype==AIRBOSS.CarrierType.VINSON then
56701
56920
  self:_InitStennis()
56702
56921
  elseif self.carriertype==AIRBOSS.CarrierType.ESSEX then
56703
56922
  self:_InitEssex()
56923
+ elseif self.carriertype==AIRBOSS.CarrierType.BONHOMMERICHARD then
56924
+ self:_InitBonHommeRichard()
56925
+ elseif self.carriertype==AIRBOSS.CarrierType.ESSEXSCB125 then
56926
+ self:_InitEssexSCB125()
56704
56927
  elseif self.carriertype==AIRBOSS.CarrierType.HERMES then
56705
56928
  self:_InitHermes()
56706
56929
  elseif self.carriertype==AIRBOSS.CarrierType.INVINCIBLE then
@@ -57153,8 +57376,7 @@ self.SRS:SetCoalition(self:GetCoalition())
57153
57376
  self.SRS:SetCoordinate(self:GetCoordinate())
57154
57377
  self.SRS:SetCulture(Culture or"en-US")
57155
57378
  self.SRS:SetGender(Gender or"male")
57156
- self.SRS:SetPath(PathToSRS)
57157
- self.SRS:SetPort(Port or 5002)
57379
+ self.SRS:SetPort(Port or MSRS.port or 5002)
57158
57380
  self.SRS:SetLabel(self.AirbossRadio.alias or"AIRBOSS")
57159
57381
  self.SRS:SetCoordinate(self.carrier:GetCoordinate())
57160
57382
  self.SRS:SetVolume(Volume or 1)
@@ -57164,7 +57386,9 @@ end
57164
57386
  if Voice then
57165
57387
  self.SRS:SetVoice(Voice)
57166
57388
  end
57167
- self.SRS:SetVolume(Volume or 1.0)
57389
+ if(not Voice)and self.SRS and self.SRS:GetProvider()==MSRS.Provider.GOOGLE then
57390
+ self.SRS.voice=MSRS.poptions["gcloud"].voice or MSRS.Voices.Google.Standard.en_US_Standard_B
57391
+ end
57168
57392
  self.SRSQ=MSRSQUEUE:New("AIRBOSS")
57169
57393
  self.SRSQ:SetTransmitOnlyWithPlayers(true)
57170
57394
  if not self.PilotRadio then
@@ -57933,6 +58157,17 @@ self.carrierparam.wire3=64
57933
58157
  self.carrierparam.wire4=74
57934
58158
  self.carrierparam.landingdist=self.carrierparam.sterndist+self.carrierparam.wire3
57935
58159
  end
58160
+ function AIRBOSS:_InitEnterprise()
58161
+ self:_InitForrestal()
58162
+ self.carrierparam.sterndist=-164.30
58163
+ self.carrierparam.deckheight=19.52
58164
+ self.carrierparam.totlength=335
58165
+ self.carrierparam.rwylength=223
58166
+ self.carrierparam.wire1=57.7
58167
+ self.carrierparam.wire2=69.6
58168
+ self.carrierparam.wire3=79.5
58169
+ self.carrierparam.wire4=90.0
58170
+ end
57936
58171
  function AIRBOSS:_InitEssex()
57937
58172
  self:_InitNimitz()
57938
58173
  self.carrierparam.sterndist=-126
@@ -57960,6 +58195,20 @@ self.carrierparam.wire14=121.0
57960
58195
  self.carrierparam.wire15=128.5
57961
58196
  self.carrierparam.landingdist=self.carrierparam.sterndist+self.carrierparam.wire3
57962
58197
  end
58198
+ function AIRBOSS:_InitBonHommeRichard()
58199
+ self:_InitEssex()
58200
+ self.carrierparam.deckheight=16.95
58201
+ self.carrierparam.rwyangle=-11.4
58202
+ self.carrierparam.rwylength=97
58203
+ self.carrierparam.rwywidth=20
58204
+ self.carrierparam.wire1=40.4
58205
+ self.carrierparam.wire2=45
58206
+ self.carrierparam.wire3=51
58207
+ self.carrierparam.wire4=58.1
58208
+ end
58209
+ function AIRBOSS:_InitEssexSCB125()
58210
+ self:_InitBonHommeRichard()
58211
+ end
57963
58212
  function AIRBOSS:_InitHermes()
57964
58213
  self:_InitStennis()
57965
58214
  self.carrierparam.sterndist=-105
@@ -69008,6 +69257,7 @@ self.enableFixedWing=false
69008
69257
  self.FixedMinAngels=165
69009
69258
  self.FixedMaxAngels=2000
69010
69259
  self.FixedMaxSpeed=77
69260
+ self.validateAndRepositionUnits=false
69011
69261
  self.suppressmessages=false
69012
69262
  self.repairtime=300
69013
69263
  self.buildtime=300
@@ -70427,6 +70677,7 @@ local Positions=self:_GetUnitPositions(randomcoord,rad,heading,_template)
70427
70677
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
70428
70678
  :InitDelayOff()
70429
70679
  :InitSetUnitAbsolutePositions(Positions)
70680
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
70430
70681
  :OnSpawnGroup(function(grp)grp.spawntime=timer.getTime()end)
70431
70682
  :SpawnFromVec2(randomcoord:GetVec2())
70432
70683
  self:__TroopsDeployed(1,Group,Unit,self.DroppedTroops[self.TroopCounter],type)
@@ -70800,11 +71051,13 @@ local alias=string.format("%s-%d",_template,math.random(1,100000))
70800
71051
  if canmove then
70801
71052
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
70802
71053
  :InitDelayOff()
71054
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
70803
71055
  :OnSpawnGroup(function(grp)grp.spawntime=timer.getTime()end)
70804
71056
  :SpawnFromVec2(randomcoord)
70805
71057
  else
70806
71058
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
70807
71059
  :InitDelayOff()
71060
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
70808
71061
  :OnSpawnGroup(function(grp)grp.spawntime=timer.getTime()end)
70809
71062
  :SpawnFromVec2(randomcoord)
70810
71063
  end
@@ -71634,6 +71887,7 @@ local Positions=self:_GetUnitPositions(randomcoord,rad,heading,_template)
71634
71887
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
71635
71888
  :InitDelayOff()
71636
71889
  :InitSetUnitAbsolutePositions(Positions)
71890
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
71637
71891
  :OnSpawnGroup(function(grp)grp.spawntime=timer.getTime()end)
71638
71892
  :SpawnFromVec2(randomcoord:GetVec2())
71639
71893
  self:__TroopsDeployed(1,Group,Unit,self.DroppedTroops[self.TroopCounter],cType)
@@ -72872,6 +73126,7 @@ self.TroopCounter=self.TroopCounter+1
72872
73126
  local alias=string.format("%s-%d",_template,math.random(1,100000))
72873
73127
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
72874
73128
  :InitRandomizeUnits(randompositions,20,2)
73129
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
72875
73130
  :InitDelayOff()
72876
73131
  :OnSpawnGroup(function(grp,TimeStamp)grp.spawntime=TimeStamp or timer.getTime()end,TimeStamp)
72877
73132
  :SpawnFromVec2(randomcoord)
@@ -72989,12 +73244,14 @@ local alias=string.format("%s-%d",_template,math.random(1,100000))
72989
73244
  if canmove then
72990
73245
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
72991
73246
  :InitRandomizeUnits(true,20,2)
73247
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
72992
73248
  :InitDelayOff()
72993
73249
  :OnSpawnGroup(function(grp,TimeStamp)grp.spawntime=TimeStamp or timer.getTime()end,TimeStamp)
72994
73250
  :SpawnFromVec2(randomcoord)
72995
73251
  else
72996
73252
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
72997
73253
  :InitDelayOff()
73254
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
72998
73255
  :OnSpawnGroup(function(grp,TimeStamp)grp.spawntime=TimeStamp or timer.getTime()end,TimeStamp)
72999
73256
  :SpawnFromVec2(randomcoord)
73000
73257
  end