summaryrefslogtreecommitdiff
path: root/src/bridge_map.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-01-13 13:17:12 +0000
committerfrosch <frosch@openttd.org>2013-01-13 13:17:12 +0000
commiteda4cfeabea022f887871dd0b40f6f6d47ae36a7 (patch)
tree0391dca58d6db63be22b70b0d4a865d400710873 /src/bridge_map.h
parent1ec4cf6ff195d09abe5a9a2f9db422af068c4e08 (diff)
downloadopenttd-eda4cfeabea022f887871dd0b40f6f6d47ae36a7.tar.xz
(svn r24912) -Fix [FS#5389]: Upgrading bridges could steal road types. (adf88)
Diffstat (limited to 'src/bridge_map.h')
-rw-r--r--src/bridge_map.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bridge_map.h b/src/bridge_map.h
index 5ab4fd552..8ee658ce7 100644
--- a/src/bridge_map.h
+++ b/src/bridge_map.h
@@ -161,15 +161,17 @@ static inline void MakeBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, D
* Make a bridge ramp for roads.
* @param t the tile to make a bridge ramp
* @param o the new owner of the bridge ramp
+ * @param owner_road the new owner of the road on the bridge
+ * @param owner_tram the new owner of the tram on the bridge
* @param bridgetype the type of bridge this bridge ramp belongs to
* @param d the direction this ramp must be facing
* @param r the road type of the bridge
*/
-static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, RoadTypes r)
+static inline void MakeRoadBridgeRamp(TileIndex t, Owner o, Owner owner_road, Owner owner_tram, BridgeType bridgetype, DiagDirection d, RoadTypes r)
{
MakeBridgeRamp(t, o, bridgetype, d, TRANSPORT_ROAD, 0);
- SetRoadOwner(t, ROADTYPE_ROAD, o);
- if (o != OWNER_TOWN) SetRoadOwner(t, ROADTYPE_TRAM, o);
+ SetRoadOwner(t, ROADTYPE_ROAD, owner_road);
+ if (owner_tram != OWNER_TOWN) SetRoadOwner(t, ROADTYPE_TRAM, owner_tram);
SetRoadTypes(t, r);
}