Remove asserts in favor of failing pathfinding
This commit is contained in:
@@ -360,7 +360,6 @@ void loadMap(Game *game, const char *path, bool mainMenu) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ecs_filter_fini(harvestableFilter);
|
ecs_filter_fini(harvestableFilter);
|
||||||
bzLogInfo("%d %d", workerIdx, harvestableIdx);
|
|
||||||
|
|
||||||
for (i32 i = 0; i < workerIdx; i++) {
|
for (i32 i = 0; i < workerIdx; i++) {
|
||||||
PosPair nearest = harvestables[0];
|
PosPair nearest = harvestables[0];
|
||||||
|
|||||||
@@ -128,8 +128,9 @@ bool pathfindAStar(const PathfindingDesc *desc) {
|
|||||||
|
|
||||||
Vec2i start = bzTileMapPosToTile(map, desc->start);
|
Vec2i start = bzTileMapPosToTile(map, desc->start);
|
||||||
Vec2i target = bzTileMapPosToTile(map, desc->target);
|
Vec2i target = bzTileMapPosToTile(map, desc->target);
|
||||||
BZ_ASSERT(start.x >= 0 && start.x < map->width);
|
if (start.x < 0 || start.x >= map->width ||
|
||||||
BZ_ASSERT(start.y >= 0 && start.y < map->height);
|
start.y < 0 || start.y >= map->height)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Perform very cheap ray cast check
|
// Perform very cheap ray cast check
|
||||||
if (bzTileMapCanRayCastLine(map, desc->start, desc->target)) {
|
if (bzTileMapCanRayCastLine(map, desc->start, desc->target)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user