Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

travelTo({range: _}) stops outside of correct range near exits #1

Open
bencbartlett opened this issue Jun 6, 2017 · 0 comments
Open

Comments

@bencbartlett
Copy link
Contributor

When using travelTo to navigate to within a certain range of a position that is near an exit, the creep will stop when it is within (range number of tiles) of the location, regardless of whether it is in the same room or not. This issue can cause creeps to idle indefinitely near room exits, especially for code that treats multiple rooms as a single unit.

For example, when navigating from a right room to within range 3 of a flag in the left room at position x=48, the creep will stop moving at x=1 of the right room. This problem is due to PathFinder terminating its path search at range 3, regardless of whether creep.pos.inRangeTo(target, range) evaluates to true.

A proposed solution would be adding a ensureSameRoom option to Traveler, which would guarantee that the creep ends up in the same room as its target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant