Skip to content

Commit

Permalink
v10 compat: Use the new way of checking a wall collision
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelVo committed Oct 13, 2022
1 parent bd76c96 commit ff9b187
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/foundry_imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ export async function moveEntities(draggedEntity, selectedEntities) {
const offsetRays = rays
.filter(ray => !ray.isPrevious)
.map(ray => applyOffsetToRay(ray, offset));
if (window.WallHeight) {
window.WallHeight.addBoundsToRays(offsetRays, draggedEntity);
}
return offsetRays.some(r => canvas.walls.checkCollision(r));
return offsetRays.some(r =>
token.checkCollision(r.B, {
origin: r.A,
mode: "any",
type: "move",
}),
);
});
if (hasCollision) {
ui.notifications.error(game.i18n.localize("ERROR.TokenCollide"));
Expand Down

0 comments on commit ff9b187

Please sign in to comment.