SpatialMap now has a full test suite and that helped find some bugs.

This commit is contained in:
Zed A. Shaw 2025-08-01 13:33:34 -04:00
parent f26189c696
commit 23ead1f0ca
3 changed files with 173 additions and 130 deletions

View file

@ -6,7 +6,9 @@ using namespace fmt;
using DinkyECS::Entity;
void SpatialMap::insert(Point pos, Entity ent, bool has_collision) {
dbc::check(!occupied(pos), "attempt to insert an entity with collision in space with collision");
if(has_collision) {
dbc::check(!occupied(pos), "attempt to insert an entity with collision in space with collision");
}
$collision.emplace(pos, CollisionData{ent, has_collision});
}