From a65aaeb43df61a9127aed0c4eb8dd4cb0b3b0bd6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 4 Feb 2024 15:18:32 +0100 Subject: b --- editor/tests/path-test.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'editor/tests') 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) -- cgit v1.2.3