mirror of
https://github.com/Wyrrrd/Gun_Turret_Alerts.git
synced 2026-06-03 15:56:38 +02:00
Fix surface handling fuckup
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 2.0.4
|
||||||
|
Date: 2024-11-09
|
||||||
|
Bugfixes:
|
||||||
|
- Fix another crash on surface deletion
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 2.0.3
|
Version: 2.0.3
|
||||||
Date: 2024-11-08
|
Date: 2024-11-08
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|||||||
+4
-4
@@ -132,13 +132,13 @@ end
|
|||||||
|
|
||||||
local function remove_surface_from_list(event)
|
local function remove_surface_from_list(event)
|
||||||
--Whenever a surface is renamed or deleted, move/remove all entities in/from the global table.
|
--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
|
local index
|
||||||
if event.new_name then
|
if event.new_name then
|
||||||
storage.ammo_entities[new_name.."_"..force.name] = table.deepcopy(storage.ammo_entities[old_name.."_"..force.name])
|
storage.ammo_entities[event.new_name.."_"..force.name] = table.deepcopy(storage.ammo_entities[event.old_name.."_"..force.name])
|
||||||
index = old_name.."_"..force.name
|
index = event.old_name.."_"..force.name
|
||||||
elseif event.surface_index then
|
elseif event.surface_index then
|
||||||
index = game.surfaces[surface_index].name.."_"..force.name
|
index = game.surfaces[event.surface_index].name.."_"..force.name
|
||||||
end
|
end
|
||||||
|
|
||||||
if index then
|
if index then
|
||||||
|
|||||||
Reference in New Issue
Block a user