Skip to content

Commit c756d93

Browse files
committed
bugfixing and ready for 0.4.16 release
-fixing #173 -making migration for 0.4.12 consume less RAM - minor readme update for 0.4.16 release
1 parent ab471cd commit c756d93

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Robot Army mod for Factorio V1.1+
22

33
## Version
4-
0.4.15,
4+
0.4.16,
55
Known to be compatible with Factorio v1.1.42. Requires at least v1.1.38 due to mod script API features used.
66

77

migrations/robotarmy_0.4.12.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ for i, force_ in pairs(game.forces) do
2626

2727
-- get the list of units
2828
-- for each unit in the list, check the type and name is what we want, add to the list.
29-
local units = surface_.find_units({area = {{-1000, -1000}, {1000, 1000}}, force = force_.name, condition = "same"})
29+
local units = surface_.find_units({area = {{-500, -500}, {500, 500}}, force = force_.name, condition = "same"})
3030
for _, unitFound in pairs(units) do
3131
if names[unitFound.name] then
3232
if unitFound.valid then
@@ -41,4 +41,5 @@ for i, force_ in pairs(game.forces) do
4141
end
4242
end
4343

44-
Game.print_all(string.format("units added in robot army migration script: %d", numUnitsAdded))
44+
Game.print_all(string.format("units added in robot army migration script: %d", numUnitsAdded))
45+
Game.print_all("Note that any units away from starting area (+-500 tiles) should be re-deployed for improved AI behaviours.")

robolib/retreat.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ function orderSquadToRetreat(squad)
1414
global.DroidAssemblers[squad.force.name], squad.unitGroup.position)
1515
local currentPos = squad.unitGroup.position
1616

17+
18+
if not squad.unitGroup then return end;
19+
if not squad.unitGroup.valid then return end;
20+
1721
if assembler then
1822
local retreatPos = getDroidSpawnLocation(assembler)
1923
if not retreatPos then

0 commit comments

Comments
 (0)