# HG changeset patch # User dominik # Date 1092154360 0 # Node ID f2e623faa778a1c315d5cad9ede0e672d081288d # Parent e9b56d50aa9910acef14045fe5c0eecfc906a3b4 (svn r8) Fix: Automatic oil refinery generation in editor diff -r e9b56d50aa99 -r f2e623faa778 industry_cmd.c --- a/industry_cmd.c Tue Aug 10 15:00:15 2004 +0000 +++ b/industry_cmd.c Tue Aug 10 16:12:40 2004 +0000 @@ -1110,9 +1110,15 @@ return true; } +extern bool _ignore_restrictions; + static bool CheckNewIndustry_Oilwell(uint tile, int type) { int x,y; + + if(_ignore_restrictions && _game_mode == GM_EDITOR) + return true; + if (type != IT_OIL_RIG && _game_mode == GM_EDITOR) return true; diff -r e9b56d50aa99 -r f2e623faa778 main_gui.c --- a/main_gui.c Tue Aug 10 15:00:15 2004 +0000 +++ b/main_gui.c Tue Aug 10 16:12:40 2004 +0000 @@ -1437,6 +1437,8 @@ { int n; + if (CreateNewIndustry(tile, type)) return true; + n = 100; do { if (CreateNewIndustry(AdjustTileCoordRandomly(tile, 1), type)) return true; @@ -1463,6 +1465,8 @@ {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 @@ _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; }