summaryrefslogtreecommitdiff
path: root/src/order_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/order_gui.cpp
parent155b912ebb2fd9e999fcd322415d5052f2ec1b08 (diff)
downloadopenttd-33d78635efdc6458e72f96f33d169ec2e7e7cde6.tar.xz
(svn r10664) -Codechange: simplify a small piece of code (skidd13)
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 6da0298ec..b3a5b08d1 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -115,7 +115,6 @@ static void DrawOrdersWindow(Window *w)
int sel;
int y, i;
bool shared_orders;
- byte color;
v = GetVehicle(w->window_number);
@@ -192,6 +191,11 @@ static void DrawOrdersWindow(Window *w)
SetDParam(1, 6);
switch (order->type) {
+ case OT_DUMMY:
+ SetDParam(1, STR_INVALID_ORDER);
+ SetDParam(2, order->dest);
+ break;
+
case OT_GOTO_STATION:
SetDParam(1, StationOrderStrings[order->flags]);
SetDParam(2, order->dest);
@@ -234,15 +238,10 @@ static void DrawOrdersWindow(Window *w)
default: break;
}
- color = (i == WP(w,order_d).sel) ? 0xC : 0x10;
+ const byte colour = (i == WP(w,order_d).sel) ? 0xC : 0x10;
SetDParam(0, i + 1);
- if (order->type != OT_DUMMY) {
- DrawString(2, y, str, color);
- } else {
- SetDParam(1, STR_INVALID_ORDER);
- SetDParam(2, order->dest);
- DrawString(2, y, str, color);
- }
+ DrawString(2, y, str, colour);
+
y += 10;
}
@@ -252,8 +251,8 @@ static void DrawOrdersWindow(Window *w)
if (i - w->vscroll.pos < w->vscroll.cap) {
str = shared_orders ? STR_END_OF_SHARED_ORDERS : STR_882A_END_OF_ORDERS;
- color = (i == WP(w,order_d).sel) ? 0xC : 0x10;
- DrawString(2, y, str, color);
+ const byte colour = (i == WP(w,order_d).sel) ? 0xC : 0x10;
+ DrawString(2, y, str, colour);
}
}