From 41d68b7145ddf5ac0e7b2fd7f0d22e428b356230 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 14 Feb 2021 17:32:00 +0000 Subject: Correctly follow rails according to wheelbase --- game/vehicles/vehicle.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'game/vehicles/vehicle.h') diff --git a/game/vehicles/vehicle.h b/game/vehicles/vehicle.h index f7defb3..8a85a28 100644 --- a/game/vehicles/vehicle.h +++ b/game/vehicles/vehicle.h @@ -5,17 +5,20 @@ #include #include #include +#include +#include class LinkHistory { public: using Entry = std::pair; using Return = std::pair; Return add(const LinkWPtr &, unsigned char); - Return getAt(float) const; + [[nodiscard]] Return getCurrent() const; + [[nodiscard]] Return getAt(float, float *) const; private: std::vector links; - float totalLen; + float totalLen {0.F}; }; class Vehicle : public WorldObject, public Physical { -- cgit v1.2.3