Skip to content

Commit

Permalink
Fix #498: Zero-initialise current_secondary_tab (#499)
Browse files Browse the repository at this point in the history
* Fix #498: Zero-initialise current_secondary_tab.

* Amend build_vehicle::open hook.
  • Loading branch information
AaronVanGeffen committed May 30, 2020
1 parent 690b0c4 commit 0eb6c77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Fix: [#487] Checkbox behaviour reversed for industry opening/closing in landscape generation options.
- Fix: [#488] Repeated clicking may lead to a negative loan.
- Fix: [#494] Farms not producing grain for stations in Mountain Mayhem scenario.
- Fix: [#498] Clicking newly invented vehicle in news throws out of range exception.

20.05 (2020-05-24)
------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/openloco/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ namespace openloco::ui
uint8_t pad_85E[0x870 - 0x85E];
uint16_t current_tab = 0; // 0x870
uint16_t frame_no = 0; // 0x872
uint16_t current_secondary_tab; // 0x874
uint16_t current_secondary_tab = 0; // 0x874
viewport_config viewport_configurations[2]; // 0x876
WindowType type; // 0x882
uint8_t pad_883[1];
Expand Down
3 changes: 2 additions & 1 deletion src/openloco/windows/build_vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,9 @@ namespace openloco::ui::build_vehicle
0x4C1AF7,
[](registers& regs) FORCE_ALIGN_ARG_POINTER -> uint8_t {
registers backup = regs;
open(regs.eax, regs.eax);
auto window = open(regs.eax, regs.eax);
regs = backup;
regs.esi = (int32_t)window;
return 0;
});
}
Expand Down

0 comments on commit 0eb6c77

Please sign in to comment.