From b193bab14838891cbaa09291f97fb222a9a1cc3f Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Thu, 31 Jul 2025 00:03:36 -0400 Subject: [PATCH] Add in the tests from finding the bug in spatial map. --- tests/map.cpp | 1 - tests/spatialmap.cpp | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/map.cpp b/tests/map.cpp index c807c49..4c76de5 100644 --- a/tests/map.cpp +++ b/tests/map.cpp @@ -6,7 +6,6 @@ #include "levelmanager.hpp" #include "systems.hpp" - using namespace fmt; using namespace nlohmann; using std::string; diff --git a/tests/spatialmap.cpp b/tests/spatialmap.cpp index 04d018a..ee00d9e 100644 --- a/tests/spatialmap.cpp +++ b/tests/spatialmap.cpp @@ -131,7 +131,11 @@ TEST_CASE("check all diagonal works", "[collision]") { // move the enemy to a new spot around the player Point move_to = {enemy_at.x + x, enemy_at.y + y}; - collider.move(enemy_at, move_to, enemy); + + if(!collider.occupied(move_to)) { + collider.move(enemy_at, move_to, enemy); + } + enemy_at = move_to; } }