Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't attempt moves when blocked by immovable actors.
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