mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-14 02:34:09 +02:00
Mtn: Remove unused locals
This commit is contained in:
parent
11eda152fc
commit
442034600e
@ -15,6 +15,7 @@ local random = math.random
|
||||
local sub = string.sub
|
||||
local sqrt = math.sqrt
|
||||
local zone_settings = Public.zone_settings
|
||||
local scenario_name = Public.scenario_name
|
||||
|
||||
local clear_breach_text_and_render = function ()
|
||||
local beam1 = Public.get('zone1_beam1')
|
||||
@ -456,9 +457,8 @@ local function on_player_changed_position(event)
|
||||
return
|
||||
end
|
||||
local surface_name = player.surface.name
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if sub(surface_name, 0, #map_name) ~= map_name then
|
||||
if sub(surface_name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -288,7 +288,6 @@ local function set_train_final_health(final_damage_amount, repair)
|
||||
end
|
||||
|
||||
local function is_protected(e)
|
||||
local map_name = 'mtn_v3'
|
||||
if string.sub(e.surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return true
|
||||
end
|
||||
@ -736,8 +735,6 @@ local function on_player_mined_entity(event)
|
||||
end
|
||||
local rpg_char = RPG.get_value_from_player(player.index)
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(entity.surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
@ -789,8 +786,6 @@ local function on_robot_mined_entity(event)
|
||||
return
|
||||
end
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(entity.surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
@ -1009,8 +1004,6 @@ local function on_entity_died(event)
|
||||
|
||||
local cause = event.cause
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(entity.surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
@ -1482,8 +1475,6 @@ local function on_built_entity(event)
|
||||
return
|
||||
end
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(entity.surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
@ -1582,8 +1573,6 @@ local function on_robot_built_entity(event)
|
||||
return
|
||||
end
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(entity.surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
@ -1679,8 +1668,6 @@ end
|
||||
local on_player_or_robot_built_tile = function (event)
|
||||
local surface = game.surfaces[event.surface_index]
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
|
@ -1629,8 +1629,6 @@ function Public.on_player_changed_position(event)
|
||||
return
|
||||
end
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(player.surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
|
@ -1094,8 +1094,6 @@ end
|
||||
function Public.on_player_or_robot_built_tile(event)
|
||||
local surface = game.surfaces[event.surface_index]
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(surface.name, 0, #scenario_name) == scenario_name then
|
||||
return
|
||||
end
|
||||
|
@ -184,7 +184,6 @@ local function hurt_players_outside_of_aura()
|
||||
|
||||
local upgrades = Public.get('upgrades')
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
Core.iter_connected_players(
|
||||
function (player)
|
||||
if sub(player.surface.name, 0, #scenario_name) == scenario_name then
|
||||
|
@ -549,8 +549,6 @@ local function on_pre_player_died(event)
|
||||
|
||||
local surface = player.surface
|
||||
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
local corpse_removal_disabled = Public.get('corpse_removal_disabled')
|
||||
if corpse_removal_disabled then
|
||||
return
|
||||
|
@ -2944,8 +2944,6 @@ end
|
||||
function Public.heavy_functions(data)
|
||||
local top_y = data.top_y
|
||||
local surface = data.surface
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
@ -3033,8 +3031,6 @@ Event.add(
|
||||
defines.events.on_chunk_generated,
|
||||
function (e)
|
||||
local surface = e.surface
|
||||
local map_name = 'mtn_v3'
|
||||
|
||||
if string.sub(surface.name, 0, #scenario_name) ~= scenario_name then
|
||||
return
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user