mirror of
https://github.com/veden/Rampant.git
synced 2025-01-28 03:29:34 +02:00
FACTO-13: Fixed chunkPack nil on processNest
This commit is contained in:
parent
af6ee77dba
commit
28b40203e6
@ -6,6 +6,7 @@ Date: 29. 12. 2021
|
||||
Tweaks:
|
||||
- Set maximum value on enemy seed to 4294967295
|
||||
Bugfixes:
|
||||
- Fixed chunkPack nil in processNests (Thanks Skallywaggz for the report)
|
||||
- Fixed random generator seed overflow (Thanks NeveHanter for the report)
|
||||
- Fixed removing chunks could index outside processQueueLength (Thanks thecheat789 for the report)
|
||||
- Fixed processMap and processStaticMap could index outside processQueueLength
|
||||
|
@ -46,6 +46,8 @@ local BASE_PROCESS_INTERVAL = constants.BASE_PROCESS_INTERVAL
|
||||
|
||||
-- imported functions
|
||||
|
||||
local removeChunkToNest = mapUtils.removeChunkToNest
|
||||
|
||||
local processStaticPheromone = pheromoneUtils.processStaticPheromone
|
||||
local processPheromone = pheromoneUtils.processPheromone
|
||||
|
||||
@ -452,7 +454,7 @@ function mapProcessor.processNests(universe, tick)
|
||||
universe.processNestIterator = next(universe.chunkToNests, chunkId)
|
||||
local map = chunkPack.map
|
||||
if not map.surface.valid then
|
||||
universe.chunkToNests[chunkId] = nil
|
||||
removeChunkToNest(universe, chunkId)
|
||||
return
|
||||
end
|
||||
local chunk = getChunkById(map, chunkId)
|
||||
@ -482,7 +484,11 @@ local function processSpawnersBody(universe, iterator, chunks)
|
||||
universe[iterator] = next(chunks, chunkId)
|
||||
local map = chunkPack.map
|
||||
if not map.surface.valid then
|
||||
chunks[chunkId] = nil
|
||||
if (iterator == "processMigrationIterator") then
|
||||
removeChunkToNest(universe, chunkId)
|
||||
else
|
||||
chunks[chunkId] = nil
|
||||
end
|
||||
return
|
||||
end
|
||||
local state = chunkPack.map.state
|
||||
|
@ -76,6 +76,16 @@ function mapUtils.nextMap(universe)
|
||||
until mapIterator == universe.mapIterator
|
||||
end
|
||||
|
||||
function mapUtils.removeChunkToNest(universe, chunkId)
|
||||
universe.chunkToNests[chunkId] = nil
|
||||
if (chunkId == universe.processNestIterator) then
|
||||
universe.processNestIterator = nil
|
||||
end
|
||||
if (chunkId == universe.processMigrationIterator) then
|
||||
universe.processNestIterator = nil
|
||||
end
|
||||
end
|
||||
|
||||
function mapUtils.removeChunkFromMap(map, x, y, chunkId)
|
||||
local universe = map.universe
|
||||
map[x][y] = nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user