From 5eee311fef689772b474891e63e65b5f40766dd0 Mon Sep 17 00:00:00 2001 From: Edoardo Lolletti Date: Tue, 17 Oct 2023 10:39:51 +0200 Subject: [PATCH] Fix blunder in OnSelectSum It was returning a wrong value for the selection type --- Game/GameBehavior.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Game/GameBehavior.cs b/Game/GameBehavior.cs index 2535b749..4f7732aa 100644 --- a/Game/GameBehavior.cs +++ b/Game/GameBehavior.cs @@ -1609,13 +1609,14 @@ private void OnSelectSum(BinaryReader packet) IList selected = _ai.OnSelectSum(cards, sumval, min, max, _select_hint, mode); _select_hint = 0; byte[] result = new byte[mandatoryCards.Count + selected.Count + 16]; - result[0] = 0; - result[1] = 1; - result[2] = 0; - result[3] = 0; + int selection_value = 2; + result[0] = (byte)(selection_value & 0xff); + result[1] = (byte)((selection_value >> 4) & 0xff); + result[2] = (byte)((selection_value >> 8) & 0xff); + result[3] = (byte)((selection_value >> 16) & 0xff); - int tot_count = mandatoryCards.Count + selected.Count; + uint tot_count = (uint)(mandatoryCards.Count + selected.Count); result[4] = (byte)(tot_count & 0xff); result[5] = (byte)((tot_count >> 4) & 0xff);