Skip to content

Commit

Permalink
Fix blunder in OnSelectSum
Browse files Browse the repository at this point in the history
It was returning a wrong value for the selection type
  • Loading branch information
edo9300 committed Oct 17, 2023
1 parent 3ebef58 commit 5eee311
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Game/GameBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1609,13 +1609,14 @@ private void OnSelectSum(BinaryReader packet)
IList<ClientCard> 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);
Expand Down

0 comments on commit 5eee311

Please sign in to comment.