mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r4893) - Fix (FS#57): Disable NPF totally for ships as it wholly kills performance (blathijs). Only for 0.4/ branch and 0.4.8.
This commit is contained in:
parent
8892c1d1de
commit
d27bedce36
|
@ -323,8 +323,7 @@ int32 CmdInsertOrder(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
|||
/* For ships, make sure that the station is not too far away from the
|
||||
* previous destination, for human players with new pathfinding disabled */
|
||||
if (v->type == VEH_Ship && IS_HUMAN_PLAYER(v->owner) &&
|
||||
sel_ord != 0 && GetVehicleOrder(v, sel_ord - 1)->type == OT_GOTO_STATION
|
||||
&& !_patches.new_pathfinding_all) {
|
||||
sel_ord != 0 && GetVehicleOrder(v, sel_ord - 1)->type == OT_GOTO_STATION) {
|
||||
|
||||
int dist = DistanceManhattan(
|
||||
GetStation(GetVehicleOrder(v, sel_ord - 1)->station)->xy,
|
||||
|
|
|
@ -64,7 +64,7 @@ static const Depot* FindClosestShipDepot(const Vehicle* v)
|
|||
uint best_dist = (uint)-1;
|
||||
TileIndex tile;
|
||||
TileIndex tile2 = v->tile;
|
||||
|
||||
#if 0
|
||||
if (_patches.new_pathfinding_all) {
|
||||
NPFFoundTargetData ftd;
|
||||
byte trackdir = GetVehicleTrackdir(v);
|
||||
|
@ -75,6 +75,8 @@ static const Depot* FindClosestShipDepot(const Vehicle* v)
|
|||
best_depot = NULL; /* Did not find target */
|
||||
}
|
||||
} else {
|
||||
#else
|
||||
{
|
||||
FOR_ALL_DEPOTS(depot) {
|
||||
tile = depot->xy;
|
||||
if (IsValidDepot(depot) && IsTileDepotType(tile, TRANSPORT_WATER) && IsTileOwner(tile, v->owner)) {
|
||||
|
@ -86,6 +88,7 @@ static const Depot* FindClosestShipDepot(const Vehicle* v)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return best_depot;
|
||||
}
|
||||
|
||||
|
@ -534,6 +537,7 @@ static int ChooseShipTrack(Vehicle *v, TileIndex tile, int enterdir, uint tracks
|
|||
{
|
||||
assert(enterdir>=0 && enterdir<=3);
|
||||
|
||||
#if 0
|
||||
if (_patches.new_pathfinding_all) {
|
||||
NPFFindStationOrTileData fstd;
|
||||
NPFFoundTargetData ftd;
|
||||
|
@ -555,6 +559,8 @@ static int ChooseShipTrack(Vehicle *v, TileIndex tile, int enterdir, uint tracks
|
|||
return -1; /* Already at target, reverse? */
|
||||
}
|
||||
} else {
|
||||
#else
|
||||
{
|
||||
uint b;
|
||||
uint tot_dist, dist;
|
||||
int track;
|
||||
|
@ -577,6 +583,7 @@ static int ChooseShipTrack(Vehicle *v, TileIndex tile, int enterdir, uint tracks
|
|||
return -1;
|
||||
return track;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static const byte _new_vehicle_direction_table[11] = {
|
||||
|
|
Loading…
Reference in New Issue