wsaunders1014 / ShowDragDistance

Shows distance you dragged the token, similar to pressing ctrl.
10 stars 13 forks source link

Fix deprecation warnings in 0.8.X #101

Open 749 opened 3 years ago

749 commented 3 years ago

Commits: fix(foundry-0.8.X): fixed deprecation warnings and updated setting defaults for dnd5e

crymic commented 2 years ago

new changes.. line 813

if(typeof canvas.terrain?.costGrid[rRow]?.[rCol] != 'undefined' && !ignoreTerrain){
            let point = canvas.terrain.cost[rRow][rCol];

            dist = (point.multiple * dist) 
}

to

if(typeof canvas.terrain?.cost[rRow]?.[rCol] != 'undefined' && !ignoreTerrain){
            let point = canvas.terrain.cost[rRow][rCol];

            dist = (point.multiple * dist) 
}

same with line 897

if(typeof canvas.terrain?.costGrid[grid.row]?.[grid.col] != 'undefined' && !ignoreTerrain){
                    let point = canvas.terrain.costGrid[grid.row][grid.col];
                    dist = (point.multiple * dist) 
}

to

if(typeof canvas.terrain?.cost[grid.row]?.[grid.col] != 'undefined' && !ignoreTerrain){
                    let point = canvas.terrain.cost[grid.row][grid.col];
                    dist = (point.multiple * dist) 
}
crymic commented 2 years ago

Another one I caught when players drag their tokens. Change Line 125 to

let ignoreTerrain = (typeof this.getToken?.ignoreTerrain) != null ? this.getToken.ignoreTerrain:false;