diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-10 00:09:41 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-10 00:09:41 +0000 |
commit | 95c56f9a14d5f1df739ee6790ad9b1359e8b49ca (patch) | |
tree | 0633dede8002451c61e386994529c9fd18272566 /game/vehicles/vehicle.cpp | |
parent | Create a new loop of test track (diff) | |
download | ilt-95c56f9a14d5f1df739ee6790ad9b1359e8b49ca.tar.bz2 ilt-95c56f9a14d5f1df739ee6790ad9b1359e8b49ca.tar.xz ilt-95c56f9a14d5f1df739ee6790ad9b1359e8b49ca.zip |
Merge nexts into ends
Diffstat (limited to 'game/vehicles/vehicle.cpp')
-rw-r--r-- | game/vehicles/vehicle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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) |