From 3abef94a3dcb0d392c9ae1ab9017ad49706966d8 Mon Sep 17 00:00:00 2001 From: roeming Date: Thu, 7 Sep 2023 13:39:24 -0400 Subject: [PATCH] Match resetAppearCheck --- src/plugProjectNishimuraU/Ujia.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugProjectNishimuraU/Ujia.cpp b/src/plugProjectNishimuraU/Ujia.cpp index fcaa3110a..1cc65027a 100644 --- a/src/plugProjectNishimuraU/Ujia.cpp +++ b/src/plugProjectNishimuraU/Ujia.cpp @@ -155,16 +155,16 @@ void Obj::setInWaterDamage() * Address: 802664E4 * Size: 0000B4 */ -void Obj::resetAppearCheck() -{ - if (gameSystem && gameSystem->mMode == GSM_PIKLOPEDIA) { - int randCheck = randFloat() * 30.0f; - int idCheck = getCreatureID(); - _2C2 = (u8)(randCheck + idCheck) << 8; - } else { - _2C2 = 0; - } +void Obj::resetAppearCheck() { + if(Game::gameSystem && Game::gameSystem->mMode == GSM_PIKLOPEDIA) { + int v = (rand() / RAND_MAX) * 30.0f; + _2C2 = (v + 5 * getCreatureID()) << 8; + } + else { + + _2C2 = 0; + } /* stwu r1, -0x20(r1) mflr r0 @@ -225,7 +225,7 @@ void Obj::resetAppearCheck() */ bool Obj::isAppearCheck() { - if (_2C2) { + if (_2C2 != 0) { _2C2++; if ((u8)_2C2 > _2C2 >> 8) { _2C2 = 0;