You've already forked ComfyFactorio
mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-09-16 09:06:21 +02:00
walls to player force
This commit is contained in:
@@ -590,12 +590,12 @@ local function wall(surface, left_top, seed)
|
|||||||
if y < 5 or y > 26 then
|
if y < 5 or y > 26 then
|
||||||
if y <= 15 then
|
if y <= 15 then
|
||||||
if math_random(1, y + 1) == 1 then
|
if math_random(1, y + 1) == 1 then
|
||||||
local e = surface.create_entity({name = "stone-wall", position = p, force = "neutral"})
|
local e = surface.create_entity({name = "stone-wall", position = p, force = "player"})
|
||||||
e.minable = false
|
e.minable = false
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if math_random(1, 32 - y) == 1 then
|
if math_random(1, 32 - y) == 1 then
|
||||||
local e = surface.create_entity({name = "stone-wall", position = p, force = "neutral"})
|
local e = surface.create_entity({name = "stone-wall", position = p, force = "player"})
|
||||||
e.minable = false
|
e.minable = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -298,7 +298,7 @@ local function get_commmands(group)
|
|||||||
for i = 1, steps, 1 do
|
for i = 1, steps, 1 do
|
||||||
group_position.x = group_position.x + vector[1]
|
group_position.x = group_position.x + vector[1]
|
||||||
group_position.y = group_position.y + vector[2]
|
group_position.y = group_position.y + vector[2]
|
||||||
local position = group.surface.find_non_colliding_position("small-biter", group_position, 64, 2)
|
local position = group.surface.find_non_colliding_position("small-biter", group_position, step_length, 2)
|
||||||
if position then
|
if position then
|
||||||
commands[#commands + 1] = {
|
commands[#commands + 1] = {
|
||||||
type = defines.command.attack_area,
|
type = defines.command.attack_area,
|
||||||
@@ -331,7 +331,7 @@ local function get_commmands(group)
|
|||||||
for i = 1, steps, 1 do
|
for i = 1, steps, 1 do
|
||||||
group_position.x = group_position.x + vector[1]
|
group_position.x = group_position.x + vector[1]
|
||||||
group_position.y = group_position.y + vector[2]
|
group_position.y = group_position.y + vector[2]
|
||||||
local position = group.surface.find_non_colliding_position("small-biter", group_position, 64, 1)
|
local position = group.surface.find_non_colliding_position("small-biter", group_position, step_length, 1)
|
||||||
if position then
|
if position then
|
||||||
commands[#commands + 1] = {
|
commands[#commands + 1] = {
|
||||||
type = defines.command.attack_area,
|
type = defines.command.attack_area,
|
||||||
|
Reference in New Issue
Block a user