Skip to content

Commit

Permalink
Fix out of bounds tile access in ErrmsgWindow::OnInitialPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
JGRennison committed Nov 6, 2019
1 parent 7174d8e commit b26e173
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ struct ErrmsgWindow : public Window, ErrorMessageData {
int scr_top = GetMainViewTop() + 20;
int scr_bot = GetMainViewBottom() - 20;

Point pt = RemapCoords2(this->position.x, this->position.y);
Point pt = RemapCoords(this->position.x, this->position.y, GetSlopePixelZOutsideMap(this->position.x, this->position.y));
const ViewPort *vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
if (this->face == INVALID_COMPANY) {
/* move x pos to opposite corner */
Expand Down

2 comments on commit b26e173

@James103
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you decide to pull-request this commit, can you change the commit title from "Fix ..." to "Fix OpenTTD/OpenTTD#7619: ..."? This is because the main OpenTTD branch enforces commit style.

@JGRennison
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all my pull requests are rebased and have new titles for each commit.
This commit makes the crash go away, which is the important bit, but I've yet to convince myself that this really does make the dialog box appear in the right part of the screen,

Please sign in to comment.