equal
deleted
inserted
replaced
867 DEBUG(npf, 1, "Could not find route to any depot from tile 0x%X.", tile); |
867 DEBUG(npf, 1, "Could not find route to any depot from tile 0x%X.", tile); |
868 } |
868 } |
869 return best_result; |
869 return best_result; |
870 } |
870 } |
871 |
871 |
872 void InitializeNPF(void) |
872 void InitializeNPF() |
873 { |
873 { |
874 init_AyStar(&_npf_aystar, NPFHash, NPF_HASH_SIZE); |
874 init_AyStar(&_npf_aystar, NPFHash, NPF_HASH_SIZE); |
875 _npf_aystar.loops_per_tick = 0; |
875 _npf_aystar.loops_per_tick = 0; |
876 _npf_aystar.max_path_cost = 0; |
876 _npf_aystar.max_path_cost = 0; |
877 //_npf_aystar.max_search_nodes = 0; |
877 //_npf_aystar.max_search_nodes = 0; |
886 * save the station id for ships. For roadvehs we don't store it either, |
886 * save the station id for ships. For roadvehs we don't store it either, |
887 * because multistop depends on vehicles actually reaching the exact |
887 * because multistop depends on vehicles actually reaching the exact |
888 * dest_tile, not just any stop of that station. |
888 * dest_tile, not just any stop of that station. |
889 * So only for train orders to stations we fill fstd->station_index, for all |
889 * So only for train orders to stations we fill fstd->station_index, for all |
890 * others only dest_coords */ |
890 * others only dest_coords */ |
891 if (v->current_order.type == OT_GOTO_STATION && v->type == VEH_Train) { |
891 if (v->current_order.type == OT_GOTO_STATION && v->type == VEH_TRAIN) { |
892 fstd->station_index = v->current_order.dest; |
892 fstd->station_index = v->current_order.dest; |
893 /* Let's take the closest tile of the station as our target for trains */ |
893 /* Let's take the closest tile of the station as our target for trains */ |
894 fstd->dest_coords = CalcClosestStationTile(v->current_order.dest, v->tile); |
894 fstd->dest_coords = CalcClosestStationTile(v->current_order.dest, v->tile); |
895 } else { |
895 } else { |
896 fstd->dest_coords = v->dest_tile; |
896 fstd->dest_coords = v->dest_tile; |