Skip to content

Commit

Permalink
Print area and positions in warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Nov 16, 2024
1 parent 5465da9 commit 8159237
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions terrain/voxel_a_star_grid_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// #include "../util/string/format.h"
#include "../constants/voxel_string_names.h"
#include "../util/math/conv.h"
#include "../util/string/format.h"

namespace zylann::voxel {

Expand Down Expand Up @@ -122,10 +123,18 @@ void VoxelAStarGrid3D::check_params(Vector3i from_position, Vector3i to_position
ZN_PRINT_WARNING("The region is empty or not defined, no path will be found");
}
if (!get_region().contains(from_position)) {
ZN_PRINT_WARNING("The current region does not contain the source position, no path will be found");
ZN_PRINT_WARNING(
format("The current region {} does not contain the source position {}, no path will be found",
get_region(),
from_position)
);
}
if (!get_region().contains(to_position)) {
ZN_PRINT_WARNING("The current region does not contain the destination, no path will be found");
ZN_PRINT_WARNING(
format("The current region {} does not contain the destination {}, no path will be found",
get_region(),
to_position)
);
}
}
#endif
Expand Down

0 comments on commit 8159237

Please sign in to comment.