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:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user