diff --git a/game/src/game/mod.rs b/game/src/game/mod.rs index 22c4adb..3ac163f 100644 --- a/game/src/game/mod.rs +++ b/game/src/game/mod.rs @@ -72,9 +72,9 @@ impl Game { target.tile = play.from; // Check for target promotion. - let hex = Hex::from_tile(play.to); + let hex = Hex::from_tile(play.from); if !target.promoted && Hex::is_back(hex.x, hex.y, target.player) { - println!("promotion {} {} ({}, {})", target.class, play.to, hex.x, hex.y); + println!("promotion {} {} ({}, {})", target.class, play.from, hex.x, hex.y); target.promoted = true; } } @@ -101,7 +101,7 @@ impl Game { self.board.pieces[pid as usize] = Some(piece); // Check for piece promotion. - let hex = Hex::from_tile(play.from); + let hex = Hex::from_tile(play.to); if !piece.promoted && Hex::is_back(hex.x, hex.y, piece.player) { println!("promotion {} {} ({}, {})", piece.class, play.to, hex.x, hex.y); if let Some(piece) = &mut self.board.pieces[pid as usize] {