From 180b0b99ed5621d311c184260ccb87223082acee Mon Sep 17 00:00:00 2001 From: Mathew Velasquez Date: Mon, 5 Oct 2015 19:19:36 -0400 Subject: [PATCH] Maps no longer wrap at edges, but display blank tiles --- src/tilemap.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tilemap.cpp b/src/tilemap.cpp index 1964de5..e1b3532 100644 --- a/src/tilemap.cpp +++ b/src/tilemap.cpp @@ -654,8 +654,13 @@ struct TilemapPrivate void handleTile(int x, int y, int z) { + int ox = x + viewpPos.x; + int oy = y + viewpPos.y; + if (ox < 0 || oy < 0 || ox >= mapData->xSize() || oy >= mapData->ySize()) + return; + int tileInd = - tableGetWrapped(*mapData, x + viewpPos.x, y + viewpPos.y, z); + tableGetWrapped(*mapData, ox, oy, z); /* Check for empty space */ if (tileInd < 48)