diff --git a/lib/oarc_utils.lua b/lib/oarc_utils.lua index 54ef041..23d9567 100644 --- a/lib/oarc_utils.lua +++ b/lib/oarc_utils.lua @@ -600,7 +600,6 @@ function ShareChatBetweenForces(player, msg) for _,force in pairs(game.forces) do if (force ~= nil) then if ((force.name ~= "enemy") and - (force.name ~= "enemy-easy") and (force.name ~= "neutral") and (force.name ~= "player") and (force ~= player.force)) then diff --git a/lib/separate_spawns.lua b/lib/separate_spawns.lua index fb70eaa..9ca865e 100644 --- a/lib/separate_spawns.lua +++ b/lib/separate_spawns.lua @@ -1064,15 +1064,10 @@ end ---@param pos MapPosition ---@return OarcUniqueSpawn? function GetClosestUniqueSpawn(surface_name, pos) - - local surface_spawns - for surface_index, spawns in pairs(storage.unique_spawns) do - if (surface_index == surface_name) then - if (table_size(spawns) == 0) then return nil end -- EXIT - No spawns on requested surface - surface_spawns = spawns - end - end - if (surface_spawns == nil) then return nil end + + local surface_spawns = storage.unique_spawns[surface_name] + if (surface_spawns == nil) then return nil end -- EXIT - No spawns on requested surface + if (table_size(surface_spawns) == 0) then return nil end -- EXIT - No spawns on requested surface local closest_dist = nil local closest_spawn = nil