mirror of https://github.com/OpenTTD/OpenTTD
(svn r6160) -Fix [ 1519167 ] Bus trying to service in depot of other company (mart3p)
thanks Darkvater for hotfix (r5897)release/0.5
parent
45fa300208
commit
5a763f32a5
|
@ -138,6 +138,10 @@ protected:
|
||||||
DiagDirection exitdir = GetRoadDepotDirection(m_new_tile);
|
DiagDirection exitdir = GetRoadDepotDirection(m_new_tile);
|
||||||
if (ReverseDiagDir(exitdir) != m_exitdir)
|
if (ReverseDiagDir(exitdir) != m_exitdir)
|
||||||
return false;
|
return false;
|
||||||
|
// don't try to enter other player's depots
|
||||||
|
if (GetTileOwner(m_new_tile) != m_veh->owner) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (IsRailTT() && IsTileDepotType(m_new_tile, TT())) {
|
if (IsRailTT() && IsTileDepotType(m_new_tile, TT())) {
|
||||||
DiagDirection exitdir = GetRailDepotDirection(m_new_tile);
|
DiagDirection exitdir = GetRailDepotDirection(m_new_tile);
|
||||||
|
|
|
@ -83,7 +83,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there are no reachable trackdirs on new tile, we have end of road
|
// if there are no reachable trackdirs on new tile, we have end of road
|
||||||
TrackFollower F;
|
TrackFollower F(Yapf().GetVehicle());
|
||||||
if (!F.Follow(tile, trackdir)) break;
|
if (!F.Follow(tile, trackdir)) break;
|
||||||
|
|
||||||
// if there are more trackdirs available & reachable, we are at the end of segment
|
// if there are more trackdirs available & reachable, we are at the end of segment
|
||||||
|
@ -235,7 +235,7 @@ public:
|
||||||
* and adds it to the open list by calling Yapf().AddNewNode(n) */
|
* and adds it to the open list by calling Yapf().AddNewNode(n) */
|
||||||
inline void PfFollowNode(Node& old_node)
|
inline void PfFollowNode(Node& old_node)
|
||||||
{
|
{
|
||||||
TrackFollower F;
|
TrackFollower F(Yapf().GetVehicle());
|
||||||
if (F.Follow(old_node.m_segment_last_tile, old_node.m_segment_last_td))
|
if (F.Follow(old_node.m_segment_last_tile, old_node.m_segment_last_td))
|
||||||
Yapf().AddMultipleNodes(&old_node, F.m_new_tile, F.m_new_td_bits);
|
Yapf().AddMultipleNodes(&old_node, F.m_new_tile, F.m_new_td_bits);
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,6 @@ public:
|
||||||
Node& n = Yapf().GetBestNode();
|
Node& n = Yapf().GetBestNode();
|
||||||
TileIndex depot_tile = n.m_segment_last_tile;
|
TileIndex depot_tile = n.m_segment_last_tile;
|
||||||
assert(IsTileDepotType(depot_tile, TRANSPORT_ROAD));
|
assert(IsTileDepotType(depot_tile, TRANSPORT_ROAD));
|
||||||
if (!IsTileOwner(depot_tile, (Owner)v->owner)) return false;
|
|
||||||
Depot* ret = GetDepotByTile(depot_tile);
|
Depot* ret = GetDepotByTile(depot_tile);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue