summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-25 11:01:44 +0000
committerrubidium <rubidium@openttd.org>2007-05-25 11:01:44 +0000
commitce842502495b34d517211d43a9468bba07a495ce (patch)
tree580ae7c52465651d6884e80e160f9c107cd0d38e
parent7ec428fe7e5e8ff82a8cd3c4cf2ff6eecb480063 (diff)
downloadopenttd-ce842502495b34d517211d43a9468bba07a495ce.tar.xz
(svn r9919) -Codechange: prepare some more places for more road types.
-rw-r--r--src/autoreplace_gui.cpp3
-rw-r--r--src/roadveh_cmd.cpp3
-rw-r--r--src/tunnelbridge_cmd.cpp6
3 files changed, 10 insertions, 2 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 9a0e1467e..e1925e7d0 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -160,6 +160,9 @@ static void GenerateReplaceVehList(Window *w, bool draw_left)
/* This is for engines we can replace to and they should depend on what we selected to replace from */
if (!IsEngineBuildable(e, type, _local_player)) continue; // we need to be able to build the engine
if (!EnginesGotCargoInCommon(e, WP(w, replaceveh_d).sel_engine[0])) continue; // the engines needs to be able to carry the same cargo
+
+ /* Road vehicles can't be replaced by trams and vice-versa */
+ if (type == VEH_ROAD && HASBIT(EngInfo(WP(w, replaceveh_d).sel_engine[0])->misc_flags, EF_ROAD_TRAM) != HASBIT(EngInfo(e)->misc_flags, EF_ROAD_TRAM)) continue;
if (e == WP(w, replaceveh_d).sel_engine[0]) continue; // we can't replace an engine into itself (that would be autorenew)
}
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index a331c430f..9a00a6af4 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -957,6 +957,9 @@ static void RoadVehCheckOvertake(Vehicle *v, Vehicle *u)
return;
}
+ /* Trams can't overtake other trams */
+ if (v->u.road.roadtype == ROADTYPE_TRAM) return;
+
if (v->direction != u->direction || !(v->direction & 1)) return;
/* Check if vehicle is in a road stop, depot, tunnel or bridge or not on a straight road */
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index ce5803f75..4be63214b 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1048,6 +1048,10 @@ void DrawBridgeMiddle(const TileInfo* ti)
pal = psid->pal;
}
+ if (GetRailType(rampsouth) == RAILTYPE_ELECTRIC) {
+ DrawCatenary(ti);
+ }
+
/* draw roof, the component of the bridge which is logically between the vehicle and the camera */
if (axis == AXIS_X) {
y += 12;
@@ -1057,8 +1061,6 @@ void DrawBridgeMiddle(const TileInfo* ti)
if (image & SPRITE_MASK) AddSortableSpriteToDraw(image, pal, x, y, 1, 16, 0x28, z);
}
- if (GetRailType(rampsouth) == RAILTYPE_ELECTRIC) DrawCatenary(ti);
-
psid++;
if (ti->z + 5 == z) {
/* draw poles below for small bridges */