diff --git a/src/pathfinder/yapf/yapf_node_ship.hpp b/src/pathfinder/yapf/yapf_node_ship.hpp index a6eae6a12e..8b79a6a47e 100644 --- a/src/pathfinder/yapf/yapf_node_ship.hpp +++ b/src/pathfinder/yapf/yapf_node_ship.hpp @@ -16,19 +16,8 @@ #include "yapf_node.hpp" /** Yapf Node for ships */ -template -struct CYapfShipNodeT : CYapfNodeT> { - typedef CYapfNodeT> base; - - TileIndex segment_last_tile; - Trackdir segment_last_td; - - void Set(CYapfShipNodeT *parent, TileIndex tile, Trackdir td, bool is_choice) - { - this->base::Set(parent, tile, td, is_choice); - this->segment_last_tile = tile; - this->segment_last_td = td; - } +template +struct CYapfShipNodeT : CYapfNodeT> { }; /* now define two major node types (that differ by key type) */ diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index 2c3b26d39d..a5f1ef67a2 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -72,7 +72,7 @@ public: /** Called by YAPF to detect if node ends in the desired destination. */ inline bool PfDetectDestination(Node &n) { - return this->PfDetectDestinationTile(n.segment_last_tile, n.segment_last_td); + return this->PfDetectDestinationTile(n.GetTile(), n.GetTrackdir()); } inline bool PfDetectDestinationTile(TileIndex tile, Trackdir trackdir) @@ -101,7 +101,7 @@ public: return true; } - n.estimate = n.cost + OctileDistanceCost(n.segment_last_tile, n.segment_last_td, destination_tile); + n.estimate = n.cost + OctileDistanceCost(n.GetTile(), n.GetTrackdir(), destination_tile); assert(n.estimate >= n.parent->estimate); return true; }