1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

FACTO-177: Added limiting of builderCount and squadCount going negative

This commit is contained in:
Aaron Veden 2022-06-17 13:27:27 -07:00
parent 482cad2502
commit 34ae40d61b
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,7 @@ Version: 3.1.2
- Increased enemy pheromone weight for pathing by 2.5x
- Increased hive spawning outside resources chunks by 5x
Bugfixes:
- Fixed sent aggressive squads count could be negative
- Fixed sent aggressive squads, builder count, squad count could be negative
- Added missing sent and max siege groups on debug log
- Fixed small amounts of death generator not being rounded to nil
- Fixed enemy base pheromone missing decay based on radius

View File

@ -437,6 +437,9 @@ function squadAttack.cleanSquads(universe, tick)
removeSquadFromChunk(squad.map, squad)
if squad.settlers then
universe.builderCount = universe.builderCount - 1
if universe.builderCount < 0 then
universe.builderCount = 0
end
else
universe.squadCount = universe.squadCount - 1
if squad.type == BASE_AI_STATE_AGGRESSIVE then
@ -446,6 +449,9 @@ function squadAttack.cleanSquads(universe, tick)
base.sentAggressiveGroups = 0
end
end
if universe.squadCount < 0 then
universe.squadCount = 0
end
end
squads[groupId] = nil
elseif (group.state == 4) then