mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Fix] Beastforms Getting Stuck (#1495)
* Fixed beastforms getting stuck * Raised version
This commit is contained in:
parent
3b7b6258a1
commit
bca7e0d3c9
3 changed files with 29 additions and 13 deletions
|
|
@ -218,12 +218,20 @@ export default class DHBeastform extends BaseDataItem {
|
|||
}
|
||||
};
|
||||
const tokenUpdate = token => {
|
||||
const { x, y } = game.system.api.documents.DhToken.getSnappedPositionInSquareGrid(
|
||||
token.object.scene.grid,
|
||||
{ x: token.x, y: token.y, elevation: token.elevation },
|
||||
width ?? token.width,
|
||||
height ?? token.height
|
||||
);
|
||||
let x = null,
|
||||
y = null;
|
||||
if (token.object?.scene?.grid) {
|
||||
const positionData = game.system.api.documents.DhToken.getSnappedPositionInSquareGrid(
|
||||
token.object.scene.grid,
|
||||
{ x: token.x, y: token.y, elevation: token.elevation },
|
||||
width ?? token.width,
|
||||
height ?? token.height
|
||||
);
|
||||
|
||||
x = positionData.x;
|
||||
y = positionData.y;
|
||||
}
|
||||
|
||||
return {
|
||||
...prototypeTokenUpdate,
|
||||
x,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue