1
0
mirror of https://github.com/veden/Rampant.git synced 2024-12-26 20:54:12 +02:00

FACTO-286: Added entity destruction on group disbanding

This commit is contained in:
Aaron Veden 2023-04-05 17:25:06 -07:00
parent ef510619fc
commit 5cb00d5bce
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,9 @@
Version: 3.3.0
Improvements:
- Re-added kamikaze squad state to prevent unit group dancing and then disbanding
- Squad compression can be triggered multiple times on a single group
Tweaks:
- On group destruction all members are destroyed to prevent orphaned biters
Bugfixes:
- Fixed occasionally compression number wouldn't appear on unit group
- Fixed squad compression could take place when attacking

View File

@ -277,7 +277,7 @@ local function addMovementPenalty(squad, chunk)
squad.kamikaze = true
squad.penalties = {}
else
for entity in pairs(squad.group.members) do
for _, entity in pairs(squad.group.members) do
if entity.valid then
entity.destroy()
end
@ -726,6 +726,11 @@ function Squad.cleanSquads(tick)
Squad.squadDispatch(squad, tick)
elseif (squad.commandTick and (squad.commandTick < tick)) then
if squad.wanders > 5 then
for _, entity in pairs(squad.group.members) do
if entity.valid then
entity.destroy()
end
end
squad.group.destroy()
else
squad.wanders = squad.wanders + 1