summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-07-23 18:40:39 +0000
committeralberth <alberth@openttd.org>2010-07-23 18:40:39 +0000
commitf601259f46fa124ed41c6edb735710f119e798bc (patch)
tree30c277314881eba2fcaf2df1cd4787316383082e
parent85c775e7f355486e2ff9bf7bd85c1055b2ec71ca (diff)
downloadopenttd-f601259f46fa124ed41c6edb735710f119e798bc.tar.xz
(svn r20207) -Codechange: Move variable declaration to first use.
-rw-r--r--src/industry_gui.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 56c478731..4328597f6 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -759,11 +759,9 @@ public:
virtual void OnClick(Point pt, int widget, int click_count)
{
- Industry *i;
-
switch (widget) {
case IVW_INFO: {
- i = Industry::Get(this->window_number);
+ Industry *i = Industry::Get(this->window_number);
/* We should work if needed.. */
if (!IsProductionAlterable(i)) return;
@@ -799,14 +797,15 @@ public:
}
} break;
- case IVW_GOTO:
- i = Industry::Get(this->window_number);
+ case IVW_GOTO: {
+ Industry *i = Industry::Get(this->window_number);
if (_ctrl_pressed) {
ShowExtraViewPortWindow(i->location.tile + TileDiffXY(1, 1));
} else {
ScrollMainWindowToTile(i->location.tile + TileDiffXY(1, 1));
}
break;
+ }
}
}