From 8d3afeaa184b1f592a051e8984a26bcb9a9801ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= <159546+serprex@users.noreply.github.com> Date: Wed, 27 May 2026 14:26:28 +0000 Subject: [PATCH] fix precedence bug in gameloop.sql --- gameloop.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gameloop.sql b/gameloop.sql index f0d1f85..83cdbf2 100644 --- a/gameloop.sql +++ b/gameloop.sql @@ -90,7 +90,7 @@ BEGIN TRANSACTION; UPDATE mobs SET x = x + cos(dir) * 0.5, y = y + sin(dir) * 0.5 WHERE kind = 'bullet'; -- Delete bullets that are out of bounds -DELETE FROM mobs WHERE x < 0 OR x >= (select max(x) from map) OR y < 0 OR y >= (select max(y) from map) AND kind = 'bullet'; +DELETE FROM mobs WHERE (x < 0 OR x >= (select max(x) from map) OR y < 0 OR y >= (select max(y) from map)) AND kind = 'bullet'; -- Delete bullets that hit walls DELETE FROM mobs b WHERE EXISTS (SELECT 1 FROM map m WHERE m.x = CAST(b.x AS INT) AND m.y = CAST(b.y AS INT) AND m.tile = '#') AND kind = 'bullet';