Clean up frand usages

This commit is contained in:
gamemasterplc 2024-04-24 16:44:04 -05:00
parent fa1cdf24db
commit 6859839770
14 changed files with 79 additions and 67 deletions

View file

@ -372,7 +372,7 @@ void fn_1_5648(void) {
for (var_r31 = 0; var_r31 < 3; var_r31++) {
BoardModelRotGet(lbl_1_bss_6C[var_r31], &sp8);
sp8.y = 0.003921569f * (360.0f * (int)(frand() & 0xFF));
sp8.y = 0.003921569f * (360.0f * frand8());
BoardModelRotSetV(lbl_1_bss_6C[var_r31], &sp8);
}
loop_3:

View file

@ -2,6 +2,7 @@
#include "game/gamework_data.h"
#include "game/chrman.h"
#include "game/frand.h"
#include "game/board/audio.h"
#include "game/board/boo_house.h"
@ -14,8 +15,6 @@
#include "game/board/star.h"
#include "game/board/window.h"
// frand.h
extern u32 frandmod(u32);
// #include "REL/w05Dll/mg_item.h"
extern void fn_1_6B28(void);
extern void fn_1_6B7C(void);
@ -362,7 +361,7 @@ void fn_1_E40(void) {
fn_1_96B4();
BoardWinCreateChoice(2, 0x27000F, 7, 0);
if (GWPlayer[temp_r31].com != 0) {
if ((frand() & 1) != 0) {
if (frandBool() != 0) {
BoardComKeySetLeft();
} else {
BoardComKeySetRight();

View file

@ -1,6 +1,7 @@
#include "REL/w05Dll.h"
#include "game/hsfdraw.h"
#include "game/frand.h"
#include "game/board/model.h"
#include "game/board/player.h"
@ -211,7 +212,7 @@ void fn_1_3514(void) {
HuAudFXPlay(0x48A);
BoardModelMotionStart(lbl_1_bss_4E[lbl_1_bss_48], 2, 0);
var_r31 = BoardSpaceLinkFlagSearch(0, GWPlayer[lbl_1_bss_4C].space_curr, 0x100);
if ((frand() & 1) != 0) {
if (frandBool() != 0) {
var_r31 = BoardSpaceLinkFlagSearch(0, var_r31, 0x200);
} else {
var_r31 = BoardSpaceLinkFlagSearch(0, var_r31, 0x400);