From 9e6e6cecaaec6cf27fd818a66a18edadd6804a2b Mon Sep 17 00:00:00 2001 From: Treeki Date: Mon, 25 Jul 2011 04:31:00 +0200 Subject: random tile hack complete! it's missing definitions though --- src/randtiles.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/randtiles.cpp b/src/randtiles.cpp index 4af3bf7..92e31ae 100644 --- a/src/randtiles.cpp +++ b/src/randtiles.cpp @@ -109,7 +109,7 @@ extern "C" void TryAndRandomise(RTilemapClass *self, BGRender *bgr) { // Found it!! // Try to make one until we meet the conditions u8 *tileNums = entry->getTileNums(); - u8 chosen = 0xFF; + u16 chosen = 0xFF; u16 *top = 0, *left = 0, *right = 0, *bottom = 0; if (entry->type == RandomTileData::CHECK_HORZ || entry->type == RandomTileData::CHECK_BOTH) { @@ -123,7 +123,8 @@ extern "C" void TryAndRandomise(RTilemapClass *self, BGRender *bgr) { } while (true) { - chosen = tileNums[MakeRandomNumber(entry->count)]; + // is there even a point to using that special random function? + chosen = (tileset << 8) | tileNums[MakeRandomNumberForTiles(entry->count)]; if (top != 0 && *top == chosen) continue; -- cgit v1.2.3