yapf/yapf_rail.cpp
changeset 3923 b84fdfe503b2
parent 3914 f5118020cd84
child 4549 60410aa1aa88
equal deleted inserted replaced
3922:90fee3ce9b75 3923:b84fdfe503b2
    49 	FORCEINLINE bool FindNearestDepotTwoWay(Vehicle *v, TileIndex t1, Trackdir td1, TileIndex t2, Trackdir td2, int max_distance, int reverse_penalty, TileIndex* depot_tile, bool* reversed)
    49 	FORCEINLINE bool FindNearestDepotTwoWay(Vehicle *v, TileIndex t1, Trackdir td1, TileIndex t2, Trackdir td2, int max_distance, int reverse_penalty, TileIndex* depot_tile, bool* reversed)
    50 	{
    50 	{
    51 		// set origin and destination nodes
    51 		// set origin and destination nodes
    52 		Yapf().SetOrigin(t1, td1, t2, td2, reverse_penalty, true);
    52 		Yapf().SetOrigin(t1, td1, t2, td2, reverse_penalty, true);
    53 		Yapf().SetDestination(v);
    53 		Yapf().SetDestination(v);
    54 		Yapf().SetMaxCost(10 * max_distance);
    54 		Yapf().SetMaxCost(YAPF_TILE_LENGTH * max_distance);
    55 
    55 
    56 		// find the best path
    56 		// find the best path
    57 		bool bFound = Yapf().FindPath(v);
    57 		bool bFound = Yapf().FindPath(v);
    58 		if (!bFound) return false;
    58 		if (!bFound) return false;
    59 
    59