1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-29 21:47:08 +02:00

port force building on build_blueprint

This commit is contained in:
danielmartin0 2024-09-26 01:54:13 +01:00 committed by Gerkiz
parent d8a39168ea
commit 6e03d2d34e
4 changed files with 19 additions and 19 deletions
maps
chronosphere
mountain_fortress_v3/stateful
pirates
utils

@ -223,7 +223,7 @@ function Public.build_blueprint(surface, position, id, force)
local item = surface.create_entity { name = "item-on-ground", position = position, stack = { name = "blueprint", count = 1 } }
local success = item.stack.import_stack(Blueprints[id])
if success <= 0 then
local ghosts = item.stack.build_blueprint { surface = surface, force = force, position = position, force_build = true }
local ghosts = item.stack.build_blueprint { surface = surface, force = force, position = position, build_mode = defines.build_mode.forced }
for _, ghost in pairs(ghosts) do
ghost.silent_revive({ raise_revive = true })
end

@ -37,7 +37,7 @@ function Public.blueprint()
local success = item.stack.import_stack(bp)
if success <= 0 then
local ghosts = item.stack.build_blueprint {surface = surface, force = 'player', position = position, force_build = true}
local ghosts = item.stack.build_blueprint { surface = surface, force = 'player', position = position, build_mode = defines.build_mode.forced }
for _, ghost in pairs(ghosts) do
local _, ent = ghost.silent_revive({ raise_revive = true })
if ent and ent.valid then

@ -1025,7 +1025,7 @@ function Public.build_from_blueprint(bp_string, surface, pos, force, flipped)
local direction = flipped and defines.direction.south or defines.direction.north
local entities = bp_entity.stack.build_blueprint { surface = surface, force = force, position = { x = pos.x, y = pos.y }, force_build = true, skip_fog_of_war = false, direction = direction }
local entities = bp_entity.stack.build_blueprint { surface = surface, force = force, position = { x = pos.x, y = pos.y }, build_mode = defines.build_mode.forced, skip_fog_of_war = false, direction = direction }
bp_entity.destroy()

@ -18,7 +18,7 @@ function Public.blueprint(surface)
local success = item.stack.import_stack(bp)
if success <= 0 then
local ghosts = item.stack.build_blueprint {surface = surface, force = 'player', position = position, force_build = true}
local ghosts = item.stack.build_blueprint { surface = surface, force = 'player', position = position, build_mode = defines.build_mode.forced }
for _, ghost in pairs(ghosts) do
local _, ent = ghost.silent_revive({ raise_revive = true })
if ent and ent.valid then