[FIXED] CTLD maxUnloadTroopsAllowed

This commit is contained in:
smiki
2026-08-27 13:53:32 +02:00
parent 4c56a46ad4
commit 5278f706f5
+30
View File
@@ -1880,6 +1880,11 @@ function SPAWN:SpawnWithIndex( SpawnIndex, NoBirth )
-- SpawnTemplate.uncontrolled = self.SpawnUnControlled
-- end
-- end
if self.BeforeTemplateSpawnFunc then
self:BeforeTemplateSpawnFunc(SpawnTemplate, SpawnIndex)
end
end
if not NoBirth then
@@ -1995,6 +2000,31 @@ function SPAWN:SpawnScheduleStop()
return self
end
--- Allows to place a CallFunction hook just before spawning the group to tweak the template.
-- The provided method will be called just before a new group is spawned, including its given parameters.
-- The first parameter of the BeforeTemplateSpawnFunc is the raw Template used to spawn the group, the second is the SpawnIndex.
-- @param #SPAWN self
-- @param #function BeforeTemplateSpawnFunc The function to be called before the group spawns.
-- @return #SPAWN
-- @usage
--
-- -- Declare SpawnObject and call a function when a new Group is spawned.
-- local SpawnObject = SPAWN:New( "SpawnObject" )
-- :InitLimit( 2, 10 )
-- :OnBeforeSpawnGroup( function( SpawnTemplate )
-- Tweaking the template units
-- end
-- )
-- :SpawnScheduled( 300, 0.3 )
--
function SPAWN:OnBeforeTemplateSpawnGroup( BeforeTemplateSpawnFunc )
--self:F( "OnBeforeSpawnGroup" )
self.BeforeTemplateSpawnFunc = BeforeTemplateSpawnFunc
return self
end
--- Allows to place a CallFunction hook when a new group spawns.
-- The provided method will be called when a new group is spawned, including its given parameters.
-- The first parameter of the SpawnFunction is the @{Wrapper.Group#GROUP} that was spawned.