summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-07-25 04:31:00 +0200
committerTreeki <treeki@gmail.com>2011-07-25 04:31:00 +0200
commit9e6e6cecaaec6cf27fd818a66a18edadd6804a2b (patch)
tree9afe0ff5e74d8d3339521b9a49cf0191dc3e0e17 /src
parentebed8b9946f7755eb624dd62595ce87edaa5657a (diff)
downloadkamek-9e6e6cecaaec6cf27fd818a66a18edadd6804a2b.tar.gz
kamek-9e6e6cecaaec6cf27fd818a66a18edadd6804a2b.zip
random tile hack complete! it's missing definitions though
Diffstat (limited to '')
-rw-r--r--src/randtiles.cpp5
1 files changed, 3 insertions, 2 deletions
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;