summaryrefslogtreecommitdiff
path: root/src/timetable_gui.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-07-23 19:24:32 +0000
committertruelight <truelight@openttd.org>2007-07-23 19:24:32 +0000
commit33d78635efdc6458e72f96f33d169ec2e7e7cde6 (patch)
tree29311fe8f60837ded26bea3508471066b649fe96 /src/timetable_gui.cpp
parent155b912ebb2fd9e999fcd322415d5052f2ec1b08 (diff)
downloadopenttd-33d78635efdc6458e72f96f33d169ec2e7e7cde6.tar.xz
(svn r10664) -Codechange: simplify a small piece of code (skidd13)
Diffstat (limited to 'src/timetable_gui.cpp')
-rw-r--r--src/timetable_gui.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp
index a978e559c..0c831692f 100644
--- a/src/timetable_gui.cpp
+++ b/src/timetable_gui.cpp
@@ -96,6 +96,10 @@ static void DrawTimetableWindow(Window *w)
SetDParam(2, STR_EMPTY);
switch (order->type) {
+ case OT_DUMMY:
+ SetDParam(0, STR_INVALID_ORDER);
+ break;
+
case OT_GOTO_STATION:
SetDParam(0, (order->flags & OF_NON_STOP) ? STR_880C_GO_NON_STOP_TO : STR_8806_GO_TO);
SetDParam(1, order->dest);
@@ -137,14 +141,8 @@ static void DrawTimetableWindow(Window *w)
default: break;
}
- byte colour = (i == selected) ? 0xC : 0x10;
-
- if (order->type != OT_DUMMY) {
- DrawString(2, y, STR_TIMETABLE_GO_TO, colour);
- } else {
- SetDParam(0, STR_INVALID_ORDER);
- DrawString(2, y, STR_TIMETABLE_GO_TO, colour);
- }
+ const byte colour = (i == selected) ? 0xC : 0x10;
+ DrawString(2, y, STR_TIMETABLE_GO_TO, colour);
order_id++;
@@ -164,7 +162,7 @@ static void DrawTimetableWindow(Window *w)
string = STR_TIMETABLE_TRAVEL_FOR;
}
- byte colour = (i == selected) ? 0xC : 0x10;
+ const byte colour = (i == selected) ? 0xC : 0x10;
DrawString(12, y, string, colour);
if (final_order) break;