mirror of https://github.com/OpenTTD/OpenTTD
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()pull/7834/head
parent
da2504a0de
commit
a1d6354caf
|
@ -224,7 +224,7 @@ public:
|
||||||
int scr_top = GetMainViewTop() + 20;
|
int scr_top = GetMainViewTop() + 20;
|
||||||
int scr_bot = GetMainViewBottom() - 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;
|
const ViewPort *vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
|
||||||
if (this->face == INVALID_COMPANY) {
|
if (this->face == INVALID_COMPANY) {
|
||||||
/* move x pos to opposite corner */
|
/* move x pos to opposite corner */
|
||||||
|
|
Loading…
Reference in New Issue