Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fix_construction_turrets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp
return
end
end
local unitSeparation = Spring.GetUnitSeparation(target_unit_id, unitID, true)
local unitSeparation = Spring.GetUnitSeparation(target_unit_id, unitID, true, true)
if UD.buildDistance == nil or unitSeparation == nil or unitSeparation > UD.buildDistance then
-- impossible command detected, issue stop command.
Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, {} )
Expand All @@ -107,7 +107,7 @@ function fixNanosAfterTheFact()
-- stop nanos assisting beyond range
targetUnitID = allCommands[1]['params'][1]
if targetUnitID ~= nil then
if Spring.GetUnitSeparation(unitID, targetUnitID, true) > UnitDefs[Spring.GetUnitDefID(unitID)].buildDistance then
if Spring.GetUnitSeparation(unitID, targetUnitID, true, true) > UnitDefs[Spring.GetUnitDefID(unitID)].buildDistance then
Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, {} )
end
end
Expand Down