1
0
mirror of https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git synced 2025-02-15 13:33:33 +02:00

Merge pull request #198 from Oarcinae/197-chunk-removed-where-rails-were-built-regrowth-world-eater

fixes #197 where abandoned base removal removes other chunks even when regrowth is disabled
This commit is contained in:
Oarcinae 2024-10-19 12:40:19 -04:00 committed by GitHub
commit fc1081e361
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -500,8 +500,12 @@ function OarcRegrowthRemoveAllChunks()
elseif (global.rg[surface_name].map[c_pos.x][c_pos.y] == REGROWTH_FLAG_REMOVAL) then
-- If regrowth is disabled, remove the chunnk from the map without deleting it.
if (not global.ocfg.regrowth.enable_regrowth or not global.rg[surface_name].active) then
global.rg[surface_name].map[c_pos.x][c_pos.y] = nil
-- If it is a normal timeout removal, don't do it if there is pollution in the chunk.
if (game.surfaces[surface_name].get_pollution({ c_pos.x * 32, c_pos.y * 32 }) > 0) then
elseif (game.surfaces[surface_name].get_pollution({ c_pos.x * 32, c_pos.y * 32 }) > 0) then
global.rg[surface_name].map[c_pos.x][c_pos.y] = game.tick
-- Else delete the chunk