summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2024-08-22 12:10:18 -0400
committerpommicket <pommicket@gmail.com>2024-08-22 12:10:18 -0400
commitae028a28f7a40b527512e362d9f059ff427493f4 (patch)
treead33d8293e5d801e88be866c71dec6319871043b /server
parent4c15884d0b46f7e77c314801891379b6b6e3efd0 (diff)
bgufixes, relative positionsing
Diffstat (limited to 'server')
-rw-r--r--server/src/main.rs4
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