Add in the tests from finding the bug in spatial map.

This commit is contained in:
Zed A. Shaw 2025-07-31 00:03:36 -04:00
parent 569d04725a
commit b193bab148
2 changed files with 5 additions and 2 deletions

View file

@ -6,7 +6,6 @@
#include "levelmanager.hpp" #include "levelmanager.hpp"
#include "systems.hpp" #include "systems.hpp"
using namespace fmt; using namespace fmt;
using namespace nlohmann; using namespace nlohmann;
using std::string; using std::string;

View file

@ -131,7 +131,11 @@ TEST_CASE("check all diagonal works", "[collision]") {
// move the enemy to a new spot around the player // move the enemy to a new spot around the player
Point move_to = {enemy_at.x + x, enemy_at.y + y}; 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; enemy_at = move_to;
} }
} }