[Fix] Beastforms Getting Stuck (#1495)

* Fixed beastforms getting stuck

* Raised version
This commit is contained in:
WBHarry 2025-12-31 04:52:19 +01:00 committed by GitHub
parent 3b7b6258a1
commit bca7e0d3c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 13 deletions

View file

@ -66,12 +66,20 @@ export default class BeastformEffect extends BaseEffect {
};
const updateToken = token => {
const { x, y } = game.system.api.documents.DhToken.getSnappedPositionInSquareGrid(
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 },
baseUpdate.width,
baseUpdate.height
);
x = positionData.x;
y = positionData.y;
}
return {
...baseUpdate,
x,

View file

@ -218,12 +218,20 @@ export default class DHBeastform extends BaseDataItem {
}
};
const tokenUpdate = token => {
const { x, y } = game.system.api.documents.DhToken.getSnappedPositionInSquareGrid(
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,

View file

@ -2,7 +2,7 @@
"id": "daggerheart",
"title": "Daggerheart",
"description": "An unofficial implementation of the Daggerheart system",
"version": "1.4.3",
"version": "1.4.4",
"compatibility": {
"minimum": "13.346",
"verified": "13.351",