diff options
Diffstat (limited to 'src')
-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]); |