summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYexo <Yexo@openttd.org>2009-01-21 23:49:59 +0000
committerYexo <Yexo@openttd.org>2009-01-21 23:49:59 +0000
commit6126db001eae810c5ff038d8b700ce348ad7aee9 (patch)
tree4592f386d87cc9ea401f7deb85bfc7949b2723c4
parent840217d71713862488169cbb744b4671d35325e1 (diff)
downloadopenttd-6126db001eae810c5ff038d8b700ce348ad7aee9.tar.xz
(svn r15201) -Fix [FS#2565] (r15190): The smallmap tried to get the owner of invalid tiles.
-rw-r--r--src/smallmap_gui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 01afe7fe4..6e76a43ee 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -292,7 +292,8 @@ static void DrawSmallMapStuff(void *dst, uint xc, uint yc, int pitch, int reps,
do {
/* check if the tile (xc,yc) is within the map range */
- if (xc < MapMaxX() && yc < MapMaxY()) {
+ uint min_xy = _settings_game.construction.freeform_edges ? 1 : 0;
+ if (IsInsideMM(xc, min_xy, MapMaxX()) && IsInsideMM(yc, min_xy, MapMaxY())) {
/* check if the dst pointer points to a pixel inside the screen buffer */
if (dst < _screen.dst_ptr) continue;
if (dst >= dst_ptr_abs_end) continue;