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

tokens.denyMove = 1 doesn't stop forced AI movement #519

Closed
Merudo opened this issue Jul 30, 2019 · 0 comments
Closed

tokens.denyMove = 1 doesn't stop forced AI movement #519

Merudo opened this issue Jul 30, 2019 · 0 comments
Assignees
Labels
bug tested This issue has been QA tested by someone other than the developer.

Comments

@Merudo
Copy link
Member

Merudo commented Jul 30, 2019

Describe the bug
When AI is enabled for pathfinding and maptool doesn't find a path to the destination, the token is forced there, even if tokens.denyMove is set to 1 in onTokenMove.

To Reproduce
Steps to reproduce the behavior:

  1. Make an area inaccessible for a token, for example a square VBL.
  2. Enable AI.
  3. Define onTokenMove() with a single line: [tokens.denyMove = 1]
  4. Try to move the token. The token can move to the inaccessible area.

Expected behavior
[tokens.denyMove = 1] prevents all movement.

MapTool Info

  • Version: 1.5.3
  • Install: New

Desktop (please complete the following information):

  • OS: Windows
  • Version: 10

Additional context
This bug might be caused by the unusual getLastPath() given for a AI forced move. Typically the path given starts with the original location of the token, but if AI forces the movement the path only contains the new location.

EDIT: I did some more testing. It appears that if the A*Pathfinding timeouts, the last waypoint gets deleted from the path. If no waypoints were set, the original location of the token gets deleted, which causes this bug.

Merudo added a commit to Merudo/maptool that referenced this issue Jul 31, 2019
The last waypoint (or initial location if no waypoint) was ignored if the next move incurred a A* timeout. Fixed by construction a direct path if there is timeout.
Merudo added a commit to Merudo/maptool that referenced this issue Jul 31, 2019
Merudo added a commit to Merudo/maptool that referenced this issue Jul 31, 2019
The last waypoint (or initial location if no waypoint) was ignored if the next move incurred a A* timeout. Fixed by construction a direct path if there is timeout.
@Phergus Phergus added the bug label Jul 31, 2019
Merudo added a commit to Merudo/maptool that referenced this issue Jul 31, 2019
The last waypoint (or initial location if no waypoint) was ignored if the next move incurred a A* timeout. Fixed by construction a direct path if there is timeout.
cwisniew added a commit that referenced this issue Aug 1, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fix #519, path not calculated right if A* timeouts
@Merudo Merudo closed this as completed Aug 1, 2019
@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tested This issue has been QA tested by someone other than the developer.
Projects
None yet
Development

No branches or pull requests

2 participants