Skip to content

Commit

Permalink
fix nil crash when loading old save (#223)
Browse files Browse the repository at this point in the history
* fix nil crash

* fix crash

* Update biofluid.lua
  • Loading branch information
zzh8829 authored Jan 13, 2024
1 parent f3a24bf commit 37bbb91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion migrations/biofluid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ require 'scripts.biofluid.biofluid-gui'
local broken_graphics = {}
local invalid_coords = {}

global.biofluid_undergrounds = global.biofluid_undergrounds or {}
global.network_positions = global.network_positions or {}

for _, surface in pairs(game.surfaces) do
local network_positions = global.network_positions[surface.index]
if network_positions then
Expand Down Expand Up @@ -42,4 +45,4 @@ end

for _, entity in pairs(broken_graphics) do
Biofluid.update_graphics(entity)
end
end
1 change: 1 addition & 0 deletions scripts/turd/turd-migration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ return function(master_tech_name, sub_tech_name)
local reset_time_in_ticks = reset_time_in_hours * 3600 * 60

global.turd_migrations = global.turd_migrations or {}
global.turd_bonuses = global.turd_bonuses or {}

for _, force in pairs(game.forces) do
global.turd_migrations[force.index] = global.turd_migrations[force.index] or {}
Expand Down

0 comments on commit 37bbb91

Please sign in to comment.