diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-02-14 17:32:00 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-02-14 17:37:45 +0000 |
commit | 41d68b7145ddf5ac0e7b2fd7f0d22e428b356230 (patch) | |
tree | 91f2636971e392c67a4fb7e959bff27d388501cd /game/vehicles/vehicle.h | |
parent | Maintain a history of links traversed (diff) | |
download | ilt-41d68b7145ddf5ac0e7b2fd7f0d22e428b356230.tar.bz2 ilt-41d68b7145ddf5ac0e7b2fd7f0d22e428b356230.tar.xz ilt-41d68b7145ddf5ac0e7b2fd7f0d22e428b356230.zip |
Correctly follow rails according to wheelbase
Diffstat (limited to 'game/vehicles/vehicle.h')
-rw-r--r-- | game/vehicles/vehicle.h | 7 |
1 files changed, 5 insertions, 2 deletions
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 <game/network/link.h> #include <game/worldobject.h> #include <string> +#include <utility> +#include <vector> class LinkHistory { public: using Entry = std::pair<LinkWPtr, unsigned char /*dir*/>; using Return = std::pair<LinkCPtr, unsigned char /*dir*/>; Return add(const LinkWPtr &, unsigned char); - Return getAt(float) const; + [[nodiscard]] Return getCurrent() const; + [[nodiscard]] Return getAt(float, float *) const; private: std::vector<Entry> links; - float totalLen; + float totalLen {0.F}; }; class Vehicle : public WorldObject, public Physical { |