Don't include the movement history in collission checks (fixes #61)

This commit is contained in:
Manuel Vögele
2021-04-21 09:05:50 +02:00
parent 9151b45874
commit 6472c1d5bd
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -1,3 +1,8 @@
## In development
### Bugfixes
- Fixed a bug that prevented tokens from being moved when their movement history collides with a wall. ([#61](https://github.com/manuelVo/foundryvtt-drag-ruler/issues/61))
## 1.5.3 ## 1.5.3
### Compatiblilty ### Compatiblilty
- Drag Ruler's Generic Speed Provider is now able to work with game systems that put non-number characters behind the tokens movement speed (like `30ft.`). One example for such a game system is Dungeon Crawl Classics. ([#60](https://github.com/manuelVo/foundryvtt-drag-ruler/issues/60)) - Drag Ruler's Generic Speed Provider is now able to work with game systems that put non-number characters behind the tokens movement speed (like `30ft.`). One example for such a game system is Dungeon Crawl Classics. ([#60](https://github.com/manuelVo/foundryvtt-drag-ruler/issues/60))
+1 -1
View File
@@ -20,7 +20,7 @@ export async function moveTokens(draggedToken, selectedTokens) {
if (!game.user.isGM) { if (!game.user.isGM) {
const hasCollision = selectedTokens.some(token => { const hasCollision = selectedTokens.some(token => {
const offset = calculateTokenOffset(token, draggedToken) const offset = calculateTokenOffset(token, draggedToken)
const offsetRays = rays.map(ray => applyOffsetToRay(ray, offset)) const offsetRays = rays.filter(ray => !ray.isPrevious).map(ray => applyOffsetToRay(ray, offset))
return offsetRays.some(r => canvas.walls.checkCollision(r)); return offsetRays.some(r => canvas.walls.checkCollision(r));
}) })
if (hasCollision) { if (hasCollision) {