diff options
author | dominik <dominik@openttd.org> | 2004-08-10 16:12:40 +0000 |
---|---|---|
committer | dominik <dominik@openttd.org> | 2004-08-10 16:12:40 +0000 |
commit | 4d148bf0fa63fb36f253bdaf57e52280881945cb (patch) | |
tree | fa27cca8d14efc09f612933ecb0c3537f12cd34a /main_gui.c | |
parent | 935be05e8ff0ba2e0c6d436d6e254f2fede73899 (diff) | |
download | openttd-4d148bf0fa63fb36f253bdaf57e52280881945cb.tar.xz |
(svn r8) Fix: Automatic oil refinery generation in editor
Diffstat (limited to 'main_gui.c')
-rw-r--r-- | main_gui.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main_gui.c b/main_gui.c index 46ec07d80..7340432d7 100644 --- a/main_gui.c +++ b/main_gui.c @@ -1437,6 +1437,8 @@ static bool TryBuildIndustry(TileIndex tile, int type) { int n; + if (CreateNewIndustry(tile, type)) return true; + n = 100; do { if (CreateNewIndustry(AdjustTileCoordRandomly(tile, 1), type)) return true; @@ -1463,6 +1465,8 @@ static const byte _industry_type_list[4][16] = { {26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36}, }; +bool _ignore_restrictions; + static void ScenEditIndustryWndProc(Window *w, WindowEvent *e) { int button; @@ -1504,10 +1508,12 @@ static void ScenEditIndustryWndProc(Window *w, WindowEvent *e) _current_player = OWNER_NONE; _generating_world = true; + _ignore_restrictions = true; if (!TryBuildIndustry(e->place.tile,type)) { SET_DPARAM16(0, type + STR_4802_COAL_MINE); ShowErrorMessage(_error_message, STR_0285_CAN_T_BUILD_HERE,e->place.pt.x, e->place.pt.y); } + _ignore_restrictions = false; _generating_world = false; break; } |