only calculate cluster when tile changes

This commit is contained in:
evanpelle
2024-12-10 16:37:43 -08:00
committed by Evan
parent 097a94e5ab
commit b97ef32adb
7 changed files with 24 additions and 17 deletions
+7 -5
View File
@@ -66,11 +66,13 @@ export class PlayerExecution implements Execution {
if (ticks - this.lastCalc > this.ticksPerClusterCalc) {
this.lastCalc = ticks
const start = performance.now()
this.removeClusters()
const end = performance.now()
if (end - start > 1000) {
console.log(`player ${this.player.name()}, took ${end - start}ms`)
if (ticks - this.player.lastTileChange() < this.ticksPerClusterCalc) {
const start = performance.now()
this.removeClusters()
const end = performance.now()
if (end - start > 1000) {
console.log(`player ${this.player.name()}, took ${end - start}ms`)
}
}
}
}