Skip to content

Commit

Permalink
Merge branch 'develop' into release/0.10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
caewok committed Sep 17, 2024
2 parents 93a9ba5 + 0dd87ce commit 55e690d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/measurement/MovePenalty.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class MovePenalty {
* @returns {object}
*/
static _constructTokenClone(token) {
const actor = new CONFIG.Actor.documentClass(token.actor.toObject());
const actor = new CONFIG.Actor.documentClass(token.actor.toObject(), {});
const document = new CONFIG.Token.documentClass(token.document.toObject());
const tClone = { document, actor, _original: token };

Expand Down Expand Up @@ -495,11 +495,13 @@ export class MovePenalty {
*/
#initializeTokenClone() {
const tClone = this.#localTokenClone;
const Terrain = CONFIG.terrainmapper.Terrain;
const tokenTerrains = Terrain.allOnToken(tClone);
if ( tokenTerrains.length ) {
CONFIG.terrainmapper.Terrain.removeFromTokenLocally(tClone, tokenTerrains, { refresh: false });
tClone.actor._initialize(); // This is slow
const Terrain = CONFIG.terrainmapper?.Terrain;
if ( Terrain ) {
const tokenTerrains = Terrain.allOnToken(tClone);
if ( tokenTerrains.length ) {
CONFIG.terrainmapper.Terrain.removeFromTokenLocally(tClone, tokenTerrains, { refresh: false });
tClone.actor._initialize(); // This is slow
}
}
return tClone;
}
Expand Down

0 comments on commit 55e690d

Please sign in to comment.