diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp index 7ad07eb70..e44c44bc5 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp @@ -112,7 +112,7 @@ void GameInteractor::RawAction::FreezePlayer() { void GameInteractor::RawAction::BurnPlayer() { Player* player = GET_PLAYER(gPlayState); for (int i = 0; i < 18; i++) { - player->bodyFlameTimers[i] = Rand_S16Offset(0, 200); + player->bodyFlameTimers[i] = (uint8_t)Rand_S16Offset(0, 200); } player->bodyIsBurning = true; func_80837C0C(gPlayState, player, 0, 0, 0, 0, 0); @@ -559,7 +559,7 @@ void GameInteractor::RawAction::SetRandomWind(bool active) { GameInteractor::State::RandomWindActive = 0; GameInteractor::State::RandomWindSecondsSinceLastDirectionChange = 0; player->pushedSpeed = 0.0f; - player->pushedYaw = 0.0f; + player->pushedYaw = 0; } } @@ -617,7 +617,7 @@ GameInteractionEffectQueryResult GameInteractor::RawAction::SpawnEnemyWithOffset } // Generate point in random angle with a radius. - float angle = Random_Float(0, 2 * M_PI); + float angle = (float)(RandomDouble() * 2 * M_PI); float radius = 150; float posXOffset = radius * cos(angle); float posZOffset = radius * sin(angle); diff --git a/soh/soh/Enhancements/randomizer/3drando/random.cpp b/soh/soh/Enhancements/randomizer/3drando/random.cpp index c37aa118b..97e57dbec 100644 --- a/soh/soh/Enhancements/randomizer/3drando/random.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/random.cpp @@ -33,14 +33,7 @@ uint32_t Random(uint32_t min, uint32_t max) { return distribution(generator); } -// Returns a random float in range [min, max-1] -float Random_Float(float min, float max) { - Random_InitSeed(); - boost::random::uniform_real_distribution distribution(min, max - 1); - return distribution(generator); -} - -// Returns a random floating point number in [0.0, 1.0] +// Returns a random floating point number in [0.0, 1.0) double RandomDouble() { boost::random::uniform_real_distribution distribution(0.0, 1.0); return distribution(generator); diff --git a/soh/soh/Enhancements/randomizer/3drando/random.hpp b/soh/soh/Enhancements/randomizer/3drando/random.hpp index 1ad054735..a1be55cc5 100644 --- a/soh/soh/Enhancements/randomizer/3drando/random.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/random.hpp @@ -9,7 +9,6 @@ void Random_Init(uint32_t seed); uint32_t Random(uint32_t min, uint32_t max); -float Random_Float(float min, float max); double RandomDouble(); // Get a random element from a vector or array