Fix server promotion check.
This commit is contained in:
parent
aaae17c6b2
commit
ffa5d45d31
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user