summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan G Rennison <j.g.rennison@gmail.com>2019-11-06 22:47:12 +0000
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-11-14 08:13:44 +0100
commita1d6354cafc8b6485d2c747eb1a6e5e638a11c55 (patch)
treefb9e7ed2610704a45684dcc6036ba19495b27135
parentda2504a0ded81d34843d75fdb3b3bd640900debb (diff)
downloadopenttd-a1d6354cafc8b6485d2c747eb1a6e5e638a11c55.tar.xz
Fix: Out of bounds tile access in ErrmsgWindow::OnInitialPosition
This fixes part A of #7619, but not part B. Vehicle::x_pos and Vehicle::y_pos are not required to be within the map bounds. See also: GetTileHeightBelowAircraft()
-rw-r--r--src/error_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/error_gui.cpp b/src/error_gui.cpp
index 2635742c9..de24be3dd 100644
--- a/src/error_gui.cpp
+++ b/src/error_gui.cpp
@@ -224,7 +224,7 @@ public:
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 */