Skip to content

Commit

Permalink
Prevented sporadic capture target loss due to bungled ownership swap
Browse files Browse the repository at this point in the history
  • Loading branch information
Decane committed Dec 16, 2019
1 parent 2cc2850 commit 3878266
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gamedata/scripts/sim_faction.script
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ function se_sim_faction:calculate_squad_tasks()
end
else
if squad_data.dest_smart.id == target_smart_id then
gr_dist = squad_data.graph_point:distance_to(target_smart_gpoint) * 0.001
gr_dist = squad_data.graph_point:distance_to(target_smart_gpoint) * 0.001 + 0.1 -- increment ensures 0-dist stayer always preferred to 0-dist mover
else
gr_dist = squad_data.graph_point_dest:distance_to(target_smart_gpoint) + 1
end
Expand Down

1 comment on commit 3878266

@Decane
Copy link
Owner Author

@Decane Decane commented on 3878266 Dec 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #100.

Please sign in to comment.