summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-06-17 02:25:45 +0000
committerbelugas <belugas@openttd.org>2008-06-17 02:25:45 +0000
commitf5f05b4e86624ee1c744832c454d54a470bc8a3a (patch)
tree46c47229e28d569fbef1446ca831df51e24fad3e
parent4782df757c80a19cd3c00d49a610206ebb5bfcab (diff)
downloadopenttd-f5f05b4e86624ee1c744832c454d54a470bc8a3a.tar.xz
(svn r13540) -Codechange: Less a magic number and a more adaptable code
-rw-r--r--src/toolbar_gui.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 2dcf6b408..cd892cec3 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -1099,8 +1099,7 @@ public:
}
uint extra_spacing_at[] = { 3, 4, 7, 8, 10, 16, 0 };
- /* Yes, it defines about 27 widgets for this toolbar */
- for (uint i = 0, x = 0, j = 0, b = 0; i < 27; i++) {
+ for (uint i = 0, x = 0, j = 0, b = 0; i < this->widget_count; i++) {
switch (i) {
case 4:
this->widget[i].left = x;