Skip to content

Commit

Permalink
Fix #487: Checkbox behaviour reversed for industry opening/closing. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronVanGeffen committed May 25, 2020
1 parent d0a53d5 commit cf49dfa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
20.05+ (???)
------------------------------------------------------------------------
- Fix: [#487] Checkbox behaviour reversed for industry opening/closing in landscape generation options.
- Fix: [#488] Repeated clicking may lead to a negative loan.

20.05 (2020-05-24)
Expand Down
4 changes: 2 additions & 2 deletions src/openloco/scenario.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace openloco::scenario

enum industry_flags
{
allow_industries_close_down = (1 << 0),
allow_industries_start_up = (1 << 1),
disallow_industries_close_down = (1 << 0),
disallow_industries_start_up = (1 << 1),
};

enum objective_flags : uint8_t
Expand Down
8 changes: 4 additions & 4 deletions src/openloco/windows/LandscapeGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1160,12 +1160,12 @@ namespace openloco::ui::windows::LandscapeGeneration
break;

case widx::check_allow_industries_close_down:
*industryFlags ^= scenario::industry_flags::allow_industries_close_down;
*industryFlags ^= scenario::industry_flags::disallow_industries_close_down;
window->invalidate();
break;

case widx::check_allow_industries_start_up:
*industryFlags ^= scenario::industry_flags::allow_industries_start_up;
*industryFlags ^= scenario::industry_flags::disallow_industries_start_up;
window->invalidate();
break;
}
Expand All @@ -1179,9 +1179,9 @@ namespace openloco::ui::windows::LandscapeGeneration
widgets[widx::num_industries].text = numIndustriesLabels[s5::getOptions().numberOfIndustries];

window->activated_widgets &= ~((1 << widx::check_allow_industries_close_down) | (1 << widx::check_allow_industries_start_up));
if (industryFlags & scenario::industry_flags::allow_industries_close_down)
if (!(industryFlags & scenario::industry_flags::disallow_industries_close_down))
window->activated_widgets |= 1 << widx::check_allow_industries_close_down;
if (industryFlags & scenario::industry_flags::allow_industries_start_up)
if (!(industryFlags & scenario::industry_flags::disallow_industries_start_up))
window->activated_widgets |= 1 << widx::check_allow_industries_start_up;
}

Expand Down

0 comments on commit cf49dfa

Please sign in to comment.