mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-01 23:13:29 +00:00
only calculate cluster when tile changes
This commit is contained in:
@@ -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`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user