async call for recalculating tiles costs (#1890)

* async call for recalculating tiles costs

* fixed setWalkingCostGrid still being a blocking process

* set exits tiles cost from the start

* removed typing error from code

Co-authored-by: Hanusiak Piotr <piotr@ltmp.co>
This commit is contained in:
Piotr Hanusiak
2022-03-08 16:28:54 +01:00
committed by GitHub
parent 7b26d16868
commit 0196eae055
4 changed files with 11 additions and 39 deletions
+1 -2
View File
@@ -571,7 +571,6 @@ export class GameScene extends DirtyScene {
this.pathfindingManager = new PathfindingManager(
this,
this.gameMap.getCollisionGrid(),
this.gameMap.getWalkingCostGrid(),
this.gameMap.getTileDimensions()
);
@@ -1450,7 +1449,7 @@ ${escapedMessage}
phaserLayers[i].setCollisionByProperty({ collides: true }, visible);
}
}
this.pathfindingManager.setCollisionGrid(this.gameMap.getCollisionGrid(), this.gameMap.getWalkingCostGrid());
this.pathfindingManager.setCollisionGrid(this.gameMap.getCollisionGrid());
this.markDirty();
}