summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map.cpp7
-rw-r--r--src/map.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/map.cpp b/src/map.cpp
index b647d5d5..b9bcb284 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -201,12 +201,17 @@ int MapLayer::getTileDrawWidth(int x1, int y1, int endX, int &width) const
Image *img1 = getTile(x1, y1);
int c = 0;
width = img1->getWidth();
+
+ // Images that don't match the tile width can't be drawn as a pattern
+ if (width != mMap->getTileWidth())
+ return c;
+
for (int x = x1 + 1; x < endX; x++)
{
Image *img = getTile(x, y1);
if (img != img1)
break;
- c ++;
+ c++;
width += img->getWidth();
}
return c;
diff --git a/src/map.h b/src/map.h
index 8d87c5be..2338452c 100644
--- a/src/map.h
+++ b/src/map.h
@@ -126,7 +126,7 @@ class MapLayer
const Actors &actors,
int debugFlags) const;
- bool isFringeLayer()
+ bool isFringeLayer() const
{ return mIsFringeLayer; }
int getTileDrawWidth(int x1, int y1, int endX, int &width) const;