🐛 (engine) Fix final rankings
This commit is contained in:
parent
01b8b9bdc6
commit
074fe8c74e
2 changed files with 3 additions and 2 deletions
|
|
@ -873,7 +873,7 @@ function calculateEndScore(G: GameState) {
|
|||
}
|
||||
|
||||
export function scores(G: GameState): number[] {
|
||||
return G.players.map((_) => 0);
|
||||
return ended(G) ? G.players.map((p) => p.money) : G.players.map((_) => 0);
|
||||
}
|
||||
|
||||
export function reconstructState(initialState: GameState, log: LogItem[]): GameState {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ export function rankings(G: GameState) {
|
|||
return p1.money - p2.money;
|
||||
}
|
||||
})
|
||||
.map((pl) => pl.id);
|
||||
.map((pl) => pl.id)
|
||||
.reverse();
|
||||
|
||||
return G.players.map((pl) => sortedPlayers.indexOf(pl.id) + 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue