From 1005f98540c51236ac829b3e38abbe3c4c3ca5ce Mon Sep 17 00:00:00 2001
From: przemo1232
Date: Mon, 5 Oct 2026 15:23:18 +0200
Subject: [PATCH] fix crash
---
changelog.txt | 1 +
scripts/tailings-pond.lua | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/changelog.txt b/changelog.txt
index f20b413f..61a9b400 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -5,6 +5,7 @@ Date: ????
- Unconflicted big bags. Resolves https://github.com/pyanodon/pybugreports/issues/1570
- Updated German locale (thanks, Spunk42!)
- Updated science pack tech icons to match in game items
+ - Fixed spilling tailings ponds potentially crashing the game if left unattended for dozens of hours. Resolves https://github.com/pyanodon/pybugreports/issues/1450
---------------------------------------------------------------------------------------------------
Version: 3.1.5
Date: 2026-09-22
diff --git a/scripts/tailings-pond.lua b/scripts/tailings-pond.lua
index 6a0f97d7..6f9c678d 100644
--- a/scripts/tailings-pond.lua
+++ b/scripts/tailings-pond.lua
@@ -151,7 +151,12 @@ local function scorch_earth(pond)
local x, y = spiral(pond.lifetime_pollution_tiles_created)
x = math.floor(x + entity.position.x--[[@as number]]) - 1
y = math.floor(y + entity.position.y--[[@as number]]) - 1
- if surface.get_tile(x, y).name ~= "polluted-ground" then
+ local next_tile = surface.get_tile(x, y)
+ if not next_tile.valid then
+ surface.request_to_generate_chunks({x, y})
+ surface.force_generate_chunk_requests()
+ end
+ if next_tile.name ~= "polluted-ground" then
tiles[#tiles + 1] = {name = "polluted-ground", position = {x = x, y = y}}
end
end