Fix server promotion check.

This commit is contained in:
yukirij 2024-08-18 17:25:47 -07:00
parent aaae17c6b2
commit ffa5d45d31

View File

@ -94,7 +94,7 @@ impl Game {
// Check if piece is promoted.
let hex = Hex::from_tile(play.from);
let offset = (piece.player as i8 * 2) - 1;
let offset = -(piece.player as i8 * 2) + 1;
if !piece.promoted && !Hex::is_valid(hex.x() as i8, hex.y() as i8 + offset) {
if let Some(piece) = &mut self.board.pieces[pid as usize] {
piece.promoted = true;