diff options
author | pommicket <pommicket@gmail.com> | 2024-08-22 12:10:18 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2024-08-22 12:10:18 -0400 |
commit | ae028a28f7a40b527512e362d9f059ff427493f4 (patch) | |
tree | ad33d8293e5d801e88be866c71dec6319871043b /server/src | |
parent | 4c15884d0b46f7e77c314801891379b6b6e3efd0 (diff) |
bgufixes, relative positionsing
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/main.rs b/server/src/main.rs index 195a102..c923c7e 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -405,7 +405,7 @@ async fn handle_websocket( .parse() .map_err(|_| Error::BadSyntax)?; for coord in [x, y] { - if !coord.is_finite() || coord < -1.0 || coord > 2.0 { + if !coord.is_finite() || coord < 0.0 || coord > 2.0 { return Err(Error::BadSyntax); } } @@ -576,7 +576,7 @@ async fn main() { &[Type::INT4, Type::FLOAT4, Type::INT4, Type::FLOAT4, Type::BPCHAR, Type::INT4]) .await.expect("couldn't prepare move_piece statement"); let connect_pieces = client.prepare_typed( - "UPDATE puzzles SET connectivity = array_replace(connectivity, connectivity[$1], connectivity[$2]) WHERE id = $3 AND $1 < width * height AND $2 < width * height", + "UPDATE puzzles SET connectivity = array_replace(connectivity, connectivity[$1], connectivity[$2]) WHERE id = $3 AND $1 <= width * height AND $2 <= width * height", &[Type::INT4, Type::INT4, Type::BPCHAR]) .await.expect("couldn't prepare connect_pieces statement"); let get_piece_info = client |