diff --git a/configure.py b/configure.py index b1428d7fb..beb0d3690 100644 --- a/configure.py +++ b/configure.py @@ -429,7 +429,7 @@ config.libs = [ Object(NonMatching, "d/actor/d_a_ib.cpp"), Object(NonMatching, "d/actor/d_a_item.cpp"), Object(Matching, "d/actor/d_a_itembase.cpp"), - Object(NonMatching, "d/actor/d_a_nh.cpp"), + Object(Matching, "d/actor/d_a_nh.cpp"), Object(NonMatching, "d/actor/d_a_npc_fa1.cpp"), Object(NonMatching, "d/actor/d_a_obj_search.cpp"), Object(NonMatching, "d/actor/d_a_player.cpp"), diff --git a/include/SSystem/SComponent/c_lib.h b/include/SSystem/SComponent/c_lib.h index a8f91526f..cb88e36af 100644 --- a/include/SSystem/SComponent/c_lib.h +++ b/include/SSystem/SComponent/c_lib.h @@ -85,6 +85,11 @@ inline T cLib_maxLimit(T val, T max) { return (T)ret; } +template +T cLib_getRndValue(T min, T range) { + return (T)(min + cM_rndF((f32)range)); +} + template T cLib_calcTimer(T* value) { if ((s32)*value != 0) { @@ -93,11 +98,6 @@ T cLib_calcTimer(T* value) { return *value; } -template -T cLib_getRndValue(T min, T range) { - return (T)(min + cM_rndF((f32)range)); -} - void MtxInit(void); void MtxTrans(f32, f32, f32, u8); void MtxScale(f32, f32, f32, u8); diff --git a/src/d/actor/d_a_nh.cpp b/src/d/actor/d_a_nh.cpp index 09db19115..b436f08a7 100644 --- a/src/d/actor/d_a_nh.cpp +++ b/src/d/actor/d_a_nh.cpp @@ -334,8 +334,8 @@ BOOL daNh_c::searchPlayer() { f32 playerDistDelta = mPlayerDist - playerDist; mPlayerDist = playerDist; if (playerDelta.absXZ() > 0.001f && playerDist < 600.0f && playerDistDelta > l_HIO.prm.mMinFrightenSpeed) { - // Player is nearby and moving closer. The Forest Firefly becomes frightened and tries to head home. - setAction(&returnAction, NULL); + // Player is nearby and moving closer. The Forest Firefly becomes frightened and tries to escape. + setAction(&escapeAction, NULL); return TRUE; } @@ -562,12 +562,12 @@ BOOL daNh_c::draw() { if (mat) { J3DTevBlock* tevBlock = mat->getTevBlock(); if (tevBlock) { - GXColorS10* color = tevBlock->getTevColor(1); + GXColorS10* color = &tevBlock->getTevColor(1)->mColor; if (color) { mGlowAlpha = ((color->r + color->g + color->b) / 3) >> 2; } - GXColor* kColor = tevBlock->getTevKColor(3); + GXColor* kColor = &tevBlock->getTevKColor(3)->mColor; if (kColor) { kColor->a = mAlpha; }