# HG changeset patch # User frosch # Date 2015-02-22 14:14:30 # Node ID 8e03a1c07920f865da2e936f64ccd03f303e3451 # Parent e02d032399fea8979e0a26c3813956d7421a28e8 (svn r27160) -Fix: Division of signed values by TILE_SIZE requires cast to stay signed. diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -847,7 +847,7 @@ void SmallMapWindow::DrawVehicles(const if (v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) continue; /* 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; if (!IsInsideMM(y, 0, dpi->height)) continue; // y is out of bounds. diff --git a/src/viewport.cpp b/src/viewport.cpp --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2569,7 +2569,7 @@ bool ScrollWindowTo(int x, int y, int z, && y >= 0 && y <= (int)MapSizeY() * (int)TILE_SIZE - 1) { z = GetSlopePixelZ(x, y); } else { - z = TileHeightOutsideMap(x / TILE_SIZE, y / TILE_SIZE); + z = TileHeightOutsideMap(x / (int)TILE_SIZE, y / (int)TILE_SIZE); } }