Skip to content

Commit 82a02c3

Browse files
Proper turn step when switching playback mode
1 parent 4ba29b8 commit 82a02c3

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

client/src/playback/Map.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ type SchemaPacket = {
3434

3535
export class CurrentMap {
3636
public readonly staticMap: StaticMap
37-
//public readonly flagData: Map<number, FlagData>
3837
public readonly paint: Int8Array
3938

4039
get width(): number {
@@ -54,25 +53,10 @@ export class CurrentMap {
5453

5554
this.staticMap = from
5655
this.paint = new Int8Array(from.initialPaint)
57-
58-
/*
59-
for (let i = 0; i < from.spawnLocations.length; i++) {
60-
// Assign initial flag data, ids are initial map locations
61-
const team = i % 2
62-
const location = from.spawnLocations[i]
63-
const flagId = this.locationToIndex(location.x, location.y)
64-
this.flagData.set(flagId, { id: flagId, team, location, carrierId: null })
65-
}
66-
*/
6756
} else {
6857
// Create current map from current map (copy)
6958

7059
this.staticMap = from.staticMap
71-
/*
72-
for (let [key, value] of from.flagData) {
73-
this.flagData.set(key, { ...value })
74-
}
75-
*/
7660
this.paint = new Int8Array(from.paint)
7761
}
7862
}

client/src/playback/Match.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default class Match {
4545
set playbackPerTurn(value: boolean) {
4646
this._playbackPerTurn = value
4747
this._currentSimulationStep = 0
48-
this.currentRound.jumpToTurn(value ? 0 : this.currentRound.turnsLength)
48+
this.currentRound.jumpToTurn(0)
4949
}
5050

5151
/**

0 commit comments

Comments
 (0)