summaryrefslogtreecommitdiffhomepage
path: root/editor/tests/path-test.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-04 15:18:32 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-04 15:18:32 +0100
commita65aaeb43df61a9127aed0c4eb8dd4cb0b3b0bd6 (patch)
tree020f69f766545fa6fc960b3fdfcb4a7cda20313d /editor/tests/path-test.cpp
parent7fa7b3bc844d61ecc986f77819a11d1e4a526c57 (diff)
b
Diffstat (limited to 'editor/tests/path-test.cpp')
-rw-r--r--editor/tests/path-test.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/editor/tests/path-test.cpp b/editor/tests/path-test.cpp
index 43e2b041..672c7aa3 100644
--- a/editor/tests/path-test.cpp
+++ b/editor/tests/path-test.cpp
@@ -1,6 +1,7 @@
#include "../tests-private.hpp"
#include "../app.hpp"
#include "compat/shared-ptr-wrapper.hpp"
+#include "compat/vector-wrapper.hpp"
#include "floormat/main.hpp"
#include "src/path-search.hpp"
#include "src/critter.hpp"
@@ -137,19 +138,16 @@ void path_test::update_pre(app& a)
auto& astar = M.astar();
auto res = astar.Dijkstra(w, pending.from, pending.to, pending.own_id, pending.max_dist, pending.own_size, 1);
- if (res)
- {
- has_result = true;
- result = {
- .from = pending.from,
- .to = pending.to,
- .path = std::move(res.path()),
- .time = res.time(),
- .cost = res.cost(),
- .distance = res.distance(),
- .found = res.is_found(),
- };
- }
+ has_result = !!res;
+ result = {
+ .from = pending.from,
+ .to = pending.to,
+ .path = std::move(res.raw_path().vec),
+ .time = res.time(),
+ .cost = res.cost(),
+ .distance = res.distance(),
+ .found = res.is_found(),
+ };
}
void path_test::update_post(app& a)