diff options
author | Loïc Guilloux <glx22@users.noreply.github.com> | 2021-07-10 14:59:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-10 14:59:17 +0200 |
commit | ddb6024bc69c63e3dafec61b3f642eedc57555cc (patch) | |
tree | a10cdfd3bd372f8b86636392013fef4bb1739f18 /src/industry_gui.cpp | |
parent | 85faa218ffe3cc8eab9c8822a9f5a5117937d8b6 (diff) | |
download | openttd-ddb6024bc69c63e3dafec61b3f642eedc57555cc.tar.xz |
Codechange: Don't explicitly unset _generating_world outside of genworld.cpp (#9418)
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r-- | src/industry_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 5757a3048..d3e3d2a16 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -608,9 +608,9 @@ public: ShowErrorMessage(STR_ERROR_CAN_T_GENERATE_INDUSTRIES, STR_ERROR_MUST_FOUND_TOWN_FIRST, WL_INFO); } else { extern void GenerateIndustries(); - _generating_world = true; + Backup<bool> old_generating_world(_generating_world, true, FILE_LINE); GenerateIndustries(); - _generating_world = false; + old_generating_world.Restore(); } } @@ -712,15 +712,15 @@ public: } Backup<CompanyID> cur_company(_current_company, OWNER_NONE, FILE_LINE); - _generating_world = true; + Backup<bool> old_generating_world(_generating_world, true, FILE_LINE); _ignore_restrictions = true; DoCommandP(tile, (layout_index << 8) | this->selected_type, seed, CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY), &CcBuildIndustry); cur_company.Restore(); + old_generating_world.Restore(); _ignore_restrictions = false; - _generating_world = false; } else { success = DoCommandP(tile, (layout_index << 8) | this->selected_type, seed, CMD_BUILD_INDUSTRY | CMD_MSG(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY)); } |