Remove asserts in favor of failing pathfinding

This commit is contained in:
2024-02-15 13:29:01 +01:00
parent f360cb6335
commit e0b6b31b17
2 changed files with 3 additions and 3 deletions

View File

@@ -360,7 +360,6 @@ void loadMap(Game *game, const char *path, bool mainMenu) {
}
}
ecs_filter_fini(harvestableFilter);
bzLogInfo("%d %d", workerIdx, harvestableIdx);
for (i32 i = 0; i < workerIdx; i++) {
PosPair nearest = harvestables[0];

View File

@@ -128,8 +128,9 @@ bool pathfindAStar(const PathfindingDesc *desc) {
Vec2i start = bzTileMapPosToTile(map, desc->start);
Vec2i target = bzTileMapPosToTile(map, desc->target);
BZ_ASSERT(start.x >= 0 && start.x < map->width);
BZ_ASSERT(start.y >= 0 && start.y < map->height);
if (start.x < 0 || start.x >= map->width ||
start.y < 0 || start.y >= map->height)
return false;
// Perform very cheap ray cast check
if (bzTileMapCanRayCastLine(map, desc->start, desc->target)) {