1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-16 02:47:48 +02:00

Fix merge conflict

This commit is contained in:
Eric Anderson 2022-05-01 14:27:29 -07:00
commit 7178bd2a41
3 changed files with 22 additions and 42 deletions

View File

@ -388,6 +388,26 @@ function Public.create_scrap(surface, position)
surface.create_entity({name = scraps[math_random(1, #scraps)], position = position, force = 'neutral'})
end
function Public.on_marked_for_deconstruction(event)
local disabled_for_deconstruction = {
['fish'] = true,
['rock-huge'] = true,
['rock-big'] = true,
['sand-rock-big'] = true,
['crash-site-spaceship-wreck-small-1'] = true,
['crash-site-spaceship-wreck-small-2'] = true,
['crash-site-spaceship-wreck-small-3'] = true,
['crash-site-spaceship-wreck-small-4'] = true,
['crash-site-spaceship-wreck-small-5'] = true,
['crash-site-spaceship-wreck-small-6'] = true
}
if event.entity and event.entity.valid then
if disabled_for_deconstruction[event.entity.name] then
event.entity.cancel_deconstruction(game.players[event.player_index].force.name)
end
end
end
local function get_ore_amount(surface_index)
local floor = surface_index - DungeonsTable.get_dungeontable().original_surface_index

View File

@ -30,19 +30,6 @@ local math_abs = math.abs
local math_floor = math.floor
local math_round = math.round
local disabled_for_deconstruction = {
['fish'] = true,
['rock-huge'] = true,
['rock-big'] = true,
['sand-rock-big'] = true,
['crash-site-spaceship-wreck-small-1'] = true,
['crash-site-spaceship-wreck-small-2'] = true,
['crash-site-spaceship-wreck-small-3'] = true,
['crash-site-spaceship-wreck-small-4'] = true,
['crash-site-spaceship-wreck-small-5'] = true,
['crash-site-spaceship-wreck-small-6'] = true
}
local function get_biome(position)
--if not a then return "concrete" end
if position.x ^ 2 + position.y ^ 2 < 6400 then
@ -359,12 +346,6 @@ local function on_entity_died(event)
expand(entity.surface, entity.position)
end
local function on_marked_for_deconstruction(event)
if disabled_for_deconstruction[event.entity.name] then
event.entity.cancel_deconstruction(game.players[event.player_index].force.name)
end
end
local function on_init()
local dungeontable = DungeonsTable.get_dungeontable()
local force = game.create_force('dungeon')
@ -445,7 +426,7 @@ end
local Event = require 'utils.event'
Event.on_init(on_init)
--Event.add(defines.events.on_tick, on_tick)
Event.add(defines.events.on_marked_for_deconstruction, on_marked_for_deconstruction)
Event.add(defines.events.on_marked_for_deconstruction, Functions.on_marked_for_deconstruction)
Event.add(defines.events.on_player_joined_game, on_player_joined_game)
Event.add(defines.events.on_player_mined_entity, on_player_mined_entity)
Event.add(defines.events.on_chunk_generated, on_chunk_generated)

View File

@ -44,19 +44,6 @@ Biomes.laboratory = require 'maps.dungeons.biome_laboratory'
local math_random = math.random
local math_round = math.round
local disabled_for_deconstruction = {
['fish'] = true,
['rock-huge'] = true,
['rock-big'] = true,
['sand-rock-big'] = true,
['crash-site-spaceship-wreck-small-1'] = true,
['crash-site-spaceship-wreck-small-2'] = true,
['crash-site-spaceship-wreck-small-3'] = true,
['crash-site-spaceship-wreck-small-4'] = true,
['crash-site-spaceship-wreck-small-5'] = true,
['crash-site-spaceship-wreck-small-6'] = true
}
local function enable_hard_rooms(position, surface_index)
local dungeon_table = DungeonsTable.get_dungeontable()
local floor = surface_index - dungeon_table.original_surface_index
@ -518,14 +505,6 @@ local function on_entity_died(event)
expand(entity.surface, entity.position)
end
local function on_marked_for_deconstruction(event)
if event.entity and event.entity.valid then
if disabled_for_deconstruction[event.entity.name] then
event.entity.cancel_deconstruction(game.players[event.player_index].force.name)
end
end
end
local function get_map_gen_settings()
local settings = {
['seed'] = math_random(1, 1000000),
@ -857,7 +836,7 @@ end
local Event = require 'utils.event'
Event.on_init(on_init)
Event.on_nth_tick(60, on_tick)
Event.add(defines.events.on_marked_for_deconstruction, on_marked_for_deconstruction)
Event.add(defines.events.on_marked_for_deconstruction, Functions.on_marked_for_deconstruction)
Event.add(defines.events.on_player_joined_game, on_player_joined_game)
Event.add(defines.events.on_player_mined_entity, on_player_mined_entity)
Event.add(defines.events.on_built_entity, on_built_entity)