From 95c56f9a14d5f1df739ee6790ad9b1359e8b49ca Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 10 Mar 2021 00:09:41 +0000 Subject: Merge nexts into ends --- game/vehicles/vehicle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'game/vehicles') diff --git a/game/vehicles/vehicle.cpp b/game/vehicles/vehicle.cpp index e30cbf9..cd2331d 100644 --- a/game/vehicles/vehicle.cpp +++ b/game/vehicles/vehicle.cpp @@ -29,9 +29,9 @@ Vehicle::move(TickDuration dur) auto curLink {linkHist.getCurrent()}; while (linkDist > curLink.first->length) { const auto location = curLink.first->positionAt(curLink.first->length, curLink.second); - auto nexts {curLink.first->nexts[1 - curLink.second]}; + auto nexts {curLink.first->ends[1 - curLink.second].nexts}; auto last = std::remove_if(nexts.begin(), nexts.end(), [ang = location.rot.y](const Link::Next & n) { - return std::abs(normalize(n.first.lock()->ends[n.second].second - ang)) > 0.1F; + return std::abs(normalize(n.first.lock()->ends[n.second].dir - ang)) > 0.1F; }); if (last != nexts.begin()) { auto next = (std::distance(nexts.begin(), last) > 1) ? orders.current()->navigate(nexts.cbegin(), last) -- cgit v1.2.3