summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-23 13:12:19 +0000
committerrubidium <rubidium@openttd.org>2013-11-23 13:12:19 +0000
commitb3e93d65208f74802595b12e682d98a4d534a328 (patch)
tree992b20c16adccf478fb80f75fd1c0805044e709e /src/order_gui.cpp
parent2e54c8fdfa237f84e8d48b30bf4811ba7ed84327 (diff)
downloadopenttd-b3e93d65208f74802595b12e682d98a4d534a328.tar.xz
(svn r26057) -Fix: a number of possibly uninitialised variables
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 0645ecb68..8123013a4 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -349,8 +349,10 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int
static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
{
- Order order;
- order.next = NULL;
+ /* Hack-ish; unpack order 0, so everything gets initialised with either zero
+ * or a suitable default value for the variable. Then also override the index
+ * as it is not coming from a pool, so would be initialised. */
+ Order order(0);
order.index = 0;
/* check depot first */