1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-28 03:29:34 +02:00

fixed base recycling processing

This commit is contained in:
Aaron Veden 2021-11-24 20:49:22 -08:00
parent 154e9f6b80
commit 870f0f83db
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 10 additions and 9 deletions

View File

@ -8,6 +8,7 @@ Date: 23. 11. 2021
- Fixed nest processing only processing half the nests (Thank you Dimm2101)
- Fixed active and raid nest processing only processing half the nests (Thank you Dimm2101)
- Fixed new enemy building upgrade could replace an entity with the same entity (Thank you Dimm2101)
- Fixed new enemy regional base recycling would only process half the bases
---------------------------------------------------------------------------------------------------
Version: 1.1.4

View File

@ -235,26 +235,26 @@ local function findBaseInitialAlignment(map, evoIndex)
return result
end
function baseUtils.recycleBases(map, tick)
local bases = map.bases
local id, base = next(bases, map.recycleBaseIterator)
local id = map.recycleBaseIterator
local base
if not id then
id, base = next(bases, nil)
else
base = bases[id]
end
if not id then
map.recycleBaseIterator = nil
return
else
map.recycleBaseIterator = next(bases, id)
if ((tick - base.tick) > BASE_COLLECTION_THRESHOLD) then
local nextId
nextId = next(bases, id)
bases[id] = nil
id = nextId
else
id = next(bases, id)
end
end
map.recycleBaseIterator = id
end
function baseUtils.upgradeEntity(entity, baseAlignment, map, disPos, evolve)
local surface = map.surface
local position = entity.position