Skip to content

Commit e70714f

Browse files
committed
Fixes issue with minimum length of play required for undoing a move
1 parent 93a1ff3 commit e70714f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tiqtak"
3-
version = "1.0.6"
3+
version = "1.0.7"
44
edition = "2024"
55
authors = ["Tolumide Shopein"]
66
exclude = [

src/game/board/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl Board {
253253
#[cfg(feature = "history")]
254254
pub fn undo(&mut self, player: Player) -> Result<Self, ApiError> {
255255
let mut logs = std::mem::take(&mut self.prev);
256-
let has_enough_history = logs.len() > 2;
256+
let has_enough_history = logs.len() >= 2;
257257
// we can only undo in this case if this player has played before, else abort the game themselve
258258
if !has_enough_history {
259259
return Err(ApiError::IllegalMove);

0 commit comments

Comments
 (0)