diff options
Diffstat (limited to 'src/randtiles.cpp')
-rw-r--r-- | src/randtiles.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/randtiles.cpp b/src/randtiles.cpp index f4853d4..1508200 100644 --- a/src/randtiles.cpp +++ b/src/randtiles.cpp @@ -146,13 +146,13 @@ extern "C" void TryAndRandomise(RTilemapClass *self, BGRender *bgr) { u16 *top = 0, *left = 0, *right = 0, *bottom = 0;
if (type == RandomTileData::CHECK_HORZ || type == RandomTileData::CHECK_BOTH) {
- left = self->getPointerToTile(bgr->curX - 1, bgr->curY);
- right = self->getPointerToTile(bgr->curX + 1, bgr->curY);
+ left = self->getPointerToTile((bgr->curX - 1) * 16, bgr->curY * 16);
+ right = self->getPointerToTile((bgr->curX + 1) * 16, bgr->curY * 16);
}
if (type == RandomTileData::CHECK_VERT || type == RandomTileData::CHECK_BOTH) {
- top = self->getPointerToTile(bgr->curX, bgr->curY - 1);
- bottom = self->getPointerToTile(bgr->curX, bgr->curY + 1);
+ top = self->getPointerToTile(bgr->curX * 16, (bgr->curY - 1) * 16);
+ bottom = self->getPointerToTile(bgr->curX * 16, (bgr->curY + 1) * 16);
}
int attempts = 0;
@@ -180,7 +180,7 @@ extern "C" void TryAndRandomise(RTilemapClass *self, BGRender *bgr) { if (special == RandomTileData::SP_VDOUBLE_BOTTOM) {
if (top == 0)
- top = self->getPointerToTile(bgr->curX, bgr->curY - 1);
+ top = self->getPointerToTile(bgr->curX * 16, (bgr->curY - 1) * 16);
*top = (chosen - 0x10);
}
|