Skip to content

Commit

Permalink
Don't attempt moves when blocked by immovable actors.
Browse files Browse the repository at this point in the history
The PathSearchOrder in Move defines a fallback mechanism. If a path cannot be found when accounting for all blocking actors, e.g. BlockedByActor.All, then the next fallback will be tried, and some actors will be ignored.

This fallback exists to help prevent actors getting blocked if the blocker might not be there forever. e.g. harvesters will want to return to the refinery to drop off resources. Without a fallback they will be blocked if another harvester is already at the refinery and dropping off. With the fallbacks, we'll ignore the other harvester and path anyway. For harvesters this works well, we know the harvester dropping off will likely have moved by the time we get there anyway.

These fallbacks go all the way to BlockedByActor.None, meaning all actors on the map are ignored and only terrain is taken into account. This can result is paths being attempted to some seemingly "impossible" locations.

We remove BlockedByActor.None as a fallback option. If a path is blocked by an immovable actors such as trees or walls, the path will not be attempted. Previously a path would only be attempted if no route over the terrain was possible, e.g. when trying to path between two islands.
  • Loading branch information
RoosterDragon committed Nov 23, 2024
1 parent 0eb173e commit 126cca9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion OpenRA.Mods.Common/Activities/Move/Move.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class Move : Activity
BlockedByActor.All,
BlockedByActor.Stationary,
BlockedByActor.Immovable,
BlockedByActor.None
};

int carryoverProgress;
Expand Down

0 comments on commit 126cca9

Please sign in to comment.