diff options
author | rubidium <rubidium@openttd.org> | 2008-01-29 00:36:55 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-01-29 00:36:55 +0000 |
commit | 1629699094b6dd708c7c379f3bb03000fad549e3 (patch) | |
tree | aa58f2dfe5d8cb2b9ca934a66092611d90ca1f05 /src/industry_gui.cpp | |
parent | c9a9103566e7be441d79255fedf9752a53ab5ee9 (diff) | |
download | openttd-1629699094b6dd708c7c379f3bb03000fad549e3.tar.xz |
(svn r12006) -Fix: implement FS#1697 without the nasty side effects as specified in FS#1712.
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r-- | src/industry_gui.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 0d0645151..23cef6229 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -253,7 +253,7 @@ static void BuildDynamicIndustryWndProc(Window *w, WindowEvent *e) _generating_world = false; } } else if (_game_mode != GM_EDITOR && _patches.raw_industry_construction == 2 && GetIndustrySpec(WP(w, fnd_d).select)->IsRawIndustry()) { - DoCommandP(0, WP(w, fnd_d).select, 0, NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY)); + DoCommandP(0, WP(w, fnd_d).select, InteractiveRandom(), NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY)); w->HandleButtonClick(DPIW_FUND_WIDGET); } else { HandlePlacePushButton(w, DPIW_FUND_WIDGET, SPR_CURSOR_INDUSTRY, VHM_RECT, NULL); @@ -272,6 +272,7 @@ static void BuildDynamicIndustryWndProc(Window *w, WindowEvent *e) bool success = true; /* We do not need to protect ourselves against "Random Many Industries" in this mode */ const IndustrySpec *indsp = GetIndustrySpec(WP(w, fnd_d).select); + uint32 seed = InteractiveRandom(); if (_game_mode == GM_EDITOR) { /* Show error if no town exists at all */ @@ -284,7 +285,7 @@ static void BuildDynamicIndustryWndProc(Window *w, WindowEvent *e) _current_player = OWNER_NONE; _generating_world = true; _ignore_restrictions = true; - success = DoCommandP(e->we.place.tile, WP(w, fnd_d).select, InteractiveRandomRange(indsp->num_table), NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY)); + success = DoCommandP(e->we.place.tile, (InteractiveRandomRange(indsp->num_table) << 16) | WP(w, fnd_d).select, seed, NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY)); if (!success) { SetDParam(0, indsp->name); ShowErrorMessage(_error_message, STR_0285_CAN_T_BUILD_HERE, e->we.place.pt.x, e->we.place.pt.y); @@ -293,7 +294,7 @@ static void BuildDynamicIndustryWndProc(Window *w, WindowEvent *e) _ignore_restrictions = false; _generating_world = false; } else { - success = DoCommandP(e->we.place.tile, WP(w, fnd_d).select, InteractiveRandomRange(indsp->num_table), NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY)); + success = DoCommandP(e->we.place.tile, (InteractiveRandomRange(indsp->num_table) << 16) | WP(w, fnd_d).select, seed, NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY)); } /* If an industry has been built, just reset the cursor and the system */ |