diff --git a/CHANGELOG.md b/CHANGELOG.md index 41ef8ec..7b73228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ### 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)) diff --git a/src/foundry_imports.js b/src/foundry_imports.js index b5d1f36..68c30f2 100644 --- a/src/foundry_imports.js +++ b/src/foundry_imports.js @@ -20,7 +20,7 @@ export async function moveTokens(draggedToken, selectedTokens) { if (!game.user.isGM) { const hasCollision = selectedTokens.some(token => { 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)); }) if (hasCollision) {