summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-03-09 22:55:04 +0000
committerpeter1138 <peter1138@openttd.org>2007-03-09 22:55:04 +0000
commitc94480ab8063727dcfedfb4968ea34f8082711f1 (patch)
tree5688d3f83c1b097508ed82b9063fbbb4bffc6046
parent8dc695edea3a0fe1145f1b799b5d5ca8b6c6dbe5 (diff)
downloadopenttd-c94480ab8063727dcfedfb4968ea34f8082711f1.tar.xz
(svn r9079) -Codechange: add WWT_LAST widget when dynamically building cargo payment graph
-rw-r--r--src/graph_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp
index ef3b62df8..f03e89d47 100644
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -799,8 +799,9 @@ void ShowCargoPaymentRates()
ResizeWindow(w, 0, num_active * 8);
/* Add widgets for each cargo type */
- w->widget_count = 3 + num_active;
- w->widget = ReallocT(w->widget, w->widget_count);
+ w->widget_count += num_active;
+ w->widget = ReallocT(w->widget, w->widget_count + 1);
+ w->widget[w->widget_count].type = WWT_LAST;
/* Set the properties of each widget */
for (uint i = 0; i != num_active; i++) {