Skip to content

Commit

Permalink
fix crash when throwing a grenade at a bitumen seep
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Jan 17, 2024
1 parent 0534697 commit 871e8e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Date: ?
Changes:
- Fixed sulfur processing tech unlocking the gas processing unit twice (https://github.com/pyanodon/pybugreports/issues/366)
- Added post-game (space science) tholins recipe to obtain small amounts of tritium without fusion.
- Fixed a crash when throwing a grenade at a bitumen seep
---------------------------------------------------------------------------------------------------
Version: 2.1.12
Date: 2024-1-8
Expand Down
9 changes: 9 additions & 0 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ local function add_seep(event)
}
assembler.set_recipe('drilling-fluids')
assembler.active = false
assembler.destructible = false
global.oil_derricks[drill.unit_number] = {
entity = drill,
base = assembler,
Expand Down Expand Up @@ -173,6 +174,14 @@ local fluid_min_tier = 0 -- Tiers are zero-indexed here, god knows why

script.on_nth_tick(update_rate, function()
for drill_id, drill in pairs(global.oil_derricks) do
if not drill.base.valid then
if drill.entity and drill.entity.valid then
drill.entity.destroy()
end
global.oil_derricks[drill_id] = nil
return
end

local drill_active = false
local drill_contents = drill.base.get_fluid_contents()
local drill_empty = next(drill_contents) == nil
Expand Down

0 comments on commit 871e8e9

Please sign in to comment.