1
0
mirror of https://github.com/Wyrrrd/Gun_Turret_Alerts.git synced 2026-04-17 19:24:52 +02:00

Fix surface handling fuckup

This commit is contained in:
Wyrrrd
2024-11-09 16:14:34 +01:00
parent e99c0e0505
commit b6df0ba763
3 changed files with 10 additions and 5 deletions

View File

@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 2.0.4
Date: 2024-11-09
Bugfixes:
- Fix another crash on surface deletion
---------------------------------------------------------------------------------------------------
Version: 2.0.3
Date: 2024-11-08
Bugfixes:

View File

@@ -132,13 +132,13 @@ end
local function remove_surface_from_list(event)
--Whenever a surface is renamed or deleted, move/remove all entities in/from the global table.
for force,_ in pairs(game.forces) do
for _,force in pairs(game.forces) do
local index
if event.new_name then
storage.ammo_entities[new_name.."_"..force.name] = table.deepcopy(storage.ammo_entities[old_name.."_"..force.name])
index = old_name.."_"..force.name
storage.ammo_entities[event.new_name.."_"..force.name] = table.deepcopy(storage.ammo_entities[event.old_name.."_"..force.name])
index = event.old_name.."_"..force.name
elseif event.surface_index then
index = game.surfaces[surface_index].name.."_"..force.name
index = game.surfaces[event.surface_index].name.."_"..force.name
end
if index then

View File

@@ -1,6 +1,6 @@
{
"name": "Gun_Turret_Alerts",
"version": "2.0.3",
"version": "2.0.4",
"title": "Ammo Alerts",
"author": "Wyrrrd",
"factorio_version": "2.0",