mirror of https://github.com/OpenTTD/OpenTTD
(svn r27160) -Fix: Division of signed values by TILE_SIZE requires cast to stay signed.
parent
fc72d3dc8f
commit
cfac8dbbc6
|
@ -847,7 +847,7 @@ void SmallMapWindow::DrawVehicles(const DrawPixelInfo *dpi, Blitter *blitter) co
|
||||||
if (v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) continue;
|
if (v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) continue;
|
||||||
|
|
||||||
/* Remap into flat coordinates. */
|
/* Remap into flat coordinates. */
|
||||||
Point pt = this->RemapTile(v->x_pos / TILE_SIZE, v->y_pos / TILE_SIZE);
|
Point pt = this->RemapTile(v->x_pos / (int)TILE_SIZE, v->y_pos / (int)TILE_SIZE);
|
||||||
|
|
||||||
int y = pt.y - dpi->top;
|
int y = pt.y - dpi->top;
|
||||||
if (!IsInsideMM(y, 0, dpi->height)) continue; // y is out of bounds.
|
if (!IsInsideMM(y, 0, dpi->height)) continue; // y is out of bounds.
|
||||||
|
|
|
@ -2569,7 +2569,7 @@ bool ScrollWindowTo(int x, int y, int z, Window *w, bool instant)
|
||||||
&& y >= 0 && y <= (int)MapSizeY() * (int)TILE_SIZE - 1) {
|
&& y >= 0 && y <= (int)MapSizeY() * (int)TILE_SIZE - 1) {
|
||||||
z = GetSlopePixelZ(x, y);
|
z = GetSlopePixelZ(x, y);
|
||||||
} else {
|
} else {
|
||||||
z = TileHeightOutsideMap(x / TILE_SIZE, y / TILE_SIZE);
|
z = TileHeightOutsideMap(x / (int)TILE_SIZE, y / (int)TILE_SIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue