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:
parent
154e9f6b80
commit
870f0f83db
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user