From 0f796447568d5155755fc424c715de1142e9b840 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 20 Nov 2024 12:56:43 +0100 Subject: [PATCH] Update u8 -> u16 front --- client/src/dojo/contractModels.ts | 5 +++++ client/src/dojo/game/models/game.ts | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/dojo/contractModels.ts b/client/src/dojo/contractModels.ts index 34c69aa1..2691b068 100644 --- a/client/src/dojo/contractModels.ts +++ b/client/src/dojo/contractModels.ts @@ -31,6 +31,9 @@ export function defineContractComponents(world: World) { combo_counter_in_tournament: RecsType.Number, max_combo_in_tournament: RecsType.Number, tournament_id: RecsType.Number, + // patch u8 -> u16 + combo_counter_2: RecsType.Number, + combo_counter_in_tournament_2: RecsType.Number, }, { metadata: { @@ -59,6 +62,8 @@ export function defineContractComponents(world: World) { "u8", "u8", "u64", + "u16", + "u16", ], customTypes: [], }, diff --git a/client/src/dojo/game/models/game.ts b/client/src/dojo/game/models/game.ts index 02f43a37..ddd2222e 100644 --- a/client/src/dojo/game/models/game.ts +++ b/client/src/dojo/game/models/game.ts @@ -65,7 +65,7 @@ export class Game { this.hammer_used = game.hammer_used; this.wave_used = game.wave_used; this.totem_used = game.totem_used; - this.combo = game.combo_counter; + this.combo = Math.max(game.combo_counter, game.combo_counter_2); this.max_combo = game.max_combo; this.score = game.score; this.buyIn = 100; // Set default buy-in of $100 @@ -75,7 +75,10 @@ export class Game { this.seed = game.seed; this.start_time = new Date(game.start_time * 1000); this.score_in_tournament = game.score_in_tournament; - this.combo_counter_in_tournament = game.combo_counter_in_tournament; + this.combo_counter_in_tournament = Math.max( + game.combo_counter_in_tournament, + game.combo_counter_in_tournament_2, + ); this.max_combo_in_tournament = game.max_combo_in_tournament; this.tournament_id = game.tournament_id;