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