summaryrefslogtreecommitdiff
path: root/game/vehicles/vehicle.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-03-10 00:09:41 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-03-10 00:09:41 +0000
commit95c56f9a14d5f1df739ee6790ad9b1359e8b49ca (patch)
tree0633dede8002451c61e386994529c9fd18272566 /game/vehicles/vehicle.cpp
parentCreate a new loop of test track (diff)
downloadilt-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.cpp4
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)