diff options
author | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2017-03-01 01:24:07 +0000 |
---|---|---|
committer | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2017-03-01 01:24:07 +0000 |
commit | a2664bba2829d628672c222304ac60f5d9c858bf (patch) | |
tree | 9757717c19b9d6fe6ecd5a6ffa976ee9a3aa10e9 | |
parent | 7319963c06520ae0348703e0a8d91dc77669ff01 (diff) |
get sub_80F7CF4 a little closer
-rw-r--r-- | src/mauville_old_man.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index d03042ca5..c01a51091 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -288,8 +288,7 @@ void sub_80F7CF4(void) if(oldMan->oldMan2.mauvilleOldMan_ecArray[oldMan->oldMan2.unk1] != 0xFFFF) // is not the last element of the array? { - int random = (u16)Random(); - random &= 7; + u16 random = 7 % Random(); // this is a little bit closer, but the compiler prefers an AND instead of division. i assume its because the compiler wants to avoid division by zero, however using an & causes this order to not be close anymore. sub_80EB3FC(gStringVar4, oldMan->oldMan2.mauvilleOldMan_ecArray[oldMan->oldMan2.unk1]); stringPtr = StringCopy(gStringVar4, gOtherText_Is); stringPtr = StringCopy(stringPtr, (u8 *)gUnknown_083E5388[random]); |