Add 8 layers to collisions
This commit is contained in:
@@ -412,7 +412,7 @@ void addEntityToInspected(ecs_entity_t entity, Game *game) {
|
||||
}
|
||||
|
||||
static bool isUnitObstructed(f32 x, f32 y, BzTileMap *map) {
|
||||
return bzTileMapHasCollision(map, x / map->tileWidth, y / map->tileHeight);
|
||||
return bzTileMapHasAnyCollision(map, x / map->tileWidth, y / map->tileHeight);
|
||||
}
|
||||
|
||||
static bool canPlaceUnit(Vector2 pos, f32 space, BzTileMap *map) {
|
||||
|
||||
@@ -81,7 +81,7 @@ ECS_DTOR(Building, building, {
|
||||
Vec2i pos = building->pos;
|
||||
Vec2i size = building->size;
|
||||
Game *game = ecs_singleton_get_mut(ECS, Game);
|
||||
bzTileMapSetCollisions(&game->map, false, pos.x, pos.y, size.x, size.y);
|
||||
bzTileMapSetCollisions(&game->map, false, COLL_LAYER_BUILDINGS, pos.x, pos.y, size.x, size.y);
|
||||
})
|
||||
ECS_MOVE(Building, dst, src, {
|
||||
*dst = *src;
|
||||
|
||||
Reference in New Issue
Block a user