From 1d5817b9064f3fba9fb56cd887e2fa6e98586820 Mon Sep 17 00:00:00 2001 From: Olek47 <92753707+Olek47@users.noreply.github.com> Date: Sun, 25 Sep 2022 13:47:42 +0200 Subject: [PATCH] Handle the issue another way --- crates/core/src/plot/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core/src/plot/commands.rs b/crates/core/src/plot/commands.rs index c0fddc66..8a3b97d5 100644 --- a/crates/core/src/plot/commands.rs +++ b/crates/core/src/plot/commands.rs @@ -98,7 +98,7 @@ impl Plot { let idx = if args.len() == 2 { match args[1].parse::() { - Ok(idx) => idx.checked_sub(1).unwrap_or(usize::MAX), + Ok(idx) => idx.wrapping_sub(1), Err(_) => { self.players[player].send_error_message("Unable to parse index"); return;