summaryrefslogtreecommitdiff
path: root/src/resources/map/maplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-01-11 02:01:33 +0300
committerAndrei Karas <akaras@inbox.ru>2017-01-11 16:42:29 +0300
commit7afa60701d62763159e9e4546f6f11430d5c3cb8 (patch)
treebe841ccc853ed45eaedebf0f23db29fa178c76ab /src/resources/map/maplayer.cpp
parent0dcedd986aa0eb8129df2b934a5fc4ebe35041d8 (diff)
downloadmv-7afa60701d62763159e9e4546f6f11430d5c3cb8.tar.gz
mv-7afa60701d62763159e9e4546f6f11430d5c3cb8.tar.bz2
mv-7afa60701d62763159e9e4546f6f11430d5c3cb8.tar.xz
mv-7afa60701d62763159e9e4546f6f11430d5c3cb8.zip
Fix maplayer issue detected by tests.
Diffstat (limited to 'src/resources/map/maplayer.cpp')
-rw-r--r--src/resources/map/maplayer.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp
index c481f8e33..90ef48e4a 100644
--- a/src/resources/map/maplayer.cpp
+++ b/src/resources/map/maplayer.cpp
@@ -109,9 +109,6 @@ void MapLayer::draw(Graphics *const graphics,
const int scrollX,
const int scrollY) const restrict
{
- if (!localPlayer)
- return;
-
BLOCK_START("MapLayer::draw")
startX -= mX;
startY -= mY;
@@ -140,7 +137,7 @@ void MapLayer::draw(Graphics *const graphics,
TileInfo *tilePtr = &mTiles[CAST_SIZE(x0 + yWidth)];
if (tilePtr->isEnabled == false)
{
- if (x0 + tilePtr->nextTile >= endX)
+ if (x0 + tilePtr->nextTile + 1 >= endX)
{
continue;
}
@@ -567,7 +564,7 @@ void MapLayer::drawFringe(Graphics *const graphics,
std::min(x0 + tilePtr->nextTile + 1, endX),
scrollX,
scrollY);
- if (x0 + tilePtr->nextTile >= endX)
+ if (x0 + tilePtr->nextTile + 1 >= endX)
{
continue;
}
@@ -657,7 +654,7 @@ void MapLayer::drawFringe(Graphics *const graphics,
TileInfo *tilePtr = &mTiles[CAST_SIZE(x0 + yWidth)];
if (tilePtr->isEnabled == false)
{
- if (x0 + tilePtr->nextTile >= endX)
+ if (x0 + tilePtr->nextTile + 1 >= endX)
continue;
x0 += tilePtr->nextTile + 1;
tilePtr = &mTiles[CAST_SIZE(x0 + yWidth)];