Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
mirrored unit group offset
Browse files Browse the repository at this point in the history
  • Loading branch information
MewMew committed Apr 18, 2020
1 parent f50351b commit 888da19
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions maps/biter_battles_v2/ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,24 @@ local function send_group(unit_group, force_name, side_target)

unit_group.set_command({
type = defines.command.compound,
structure_type = defines.compound_command.return_last,
structure_type = defines.compound_command.logical_and,
commands = commands
})
return true
end

local function get_unit_group_position(spawner)
local p = spawner.surface.find_non_colliding_position("electric-furnace", spawner.position, 512, 1)
local p
if spawner.force.name == "north_biters" then
p = {x = spawner.position.x, y = spawner.position.y + 4}
else
p = {x = spawner.position.x, y = spawner.position.y - 4}
end
p = spawner.surface.find_non_colliding_position("electric-furnace", p, 512, 1)
if not p then
if global.bb_debug then game.print("No unit_group_position found for team " .. spawner.force.name) end
return
end
end
return p
end

Expand Down

0 comments on commit 888da19

Please sign in to comment.