diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-11-23 18:23:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-23 15:23:44 -0800 |
| commit | 8d53f6dd591abb21e9474a5ad85ee19eb58f2e50 (patch) | |
| tree | fa0119425e15c8be3f7833b6b4379b8eb50412cc /src/d/actor/d_a_npc_cd2.cpp | |
| parent | eaf980174f97ca1ee08df8c93a4459fba9527bad (diff) | |
Fix more nonmatchings (#2850)
* Fix GetPolyIndex and GetBgIndex, fixing a couple regallocs
* Match daNpcCd2_c::checkFearSituation and daNpcCd2_c::getAnmP
* Match daAlink_c::jointControll
* Clean up float class checks
* Move float constants to global.h
Diffstat (limited to 'src/d/actor/d_a_npc_cd2.cpp')
| -rw-r--r-- | src/d/actor/d_a_npc_cd2.cpp | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/src/d/actor/d_a_npc_cd2.cpp b/src/d/actor/d_a_npc_cd2.cpp index f20cb12f09..594495344e 100644 --- a/src/d/actor/d_a_npc_cd2.cpp +++ b/src/d/actor/d_a_npc_cd2.cpp @@ -388,6 +388,8 @@ static anmTblPrm const l_btpTWTbl[30] = { l_resMATa2[1], -1, l_resWCNa2[1], 7, l_resWONa2[1], 7, l_resWGNa2[1], 7, l_resWANb2[1], 7, }; +// TODO: these four tables should be converted into proper structs instead of byte arrays + /* 803B6604-803B7DC4 013724 17C0+00 0/1 0/0 0/0 .data a_jntTbl_M$3910 */ #pragma push #pragma force_active on @@ -1391,8 +1393,10 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) { break; } break; - case 4: - case 5: + case 6: + case 0x17: + case 0x1b: + case 0x1f: switch (param_2) { case 1: case 8: @@ -1416,11 +1420,11 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) { break; } break; - case 6: - case 0x17: - case 0x1b: - case 0x1f: - switch (param_2) { + case 7: + case 0x18: + case 0x1c: + case 0x20: + switch (param_2) { case 1: case 8: a_anmNum = 0x20; @@ -1443,10 +1447,8 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) { break; } break; - case 7: - case 0x18: - case 0x1c: - case 0x20: + case 4: + case 5: switch(param_2) { case 0: break; @@ -1489,6 +1491,17 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) { case 0x14: case 0x15: switch(param_2) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 8: + case 9: + case 10: + case 11: + case 12: + break; case 6: case 7: a_anmNum = 0x22; @@ -1883,21 +1896,13 @@ daTagEscape_c* daNpcCd2_c::getEscapeTag() { /* 80159818-801598E8 154158 00D0+00 0/0 0/0 5/5 .text checkFearSituation__10daNpcCd2_cFv */ -// NONMATCHING - r30 needs to be assigned to r4 and r5 bool daNpcCd2_c::checkFearSituation() { f32 dVar10 = fopAcM_GetPosition_p(this)->y - fopAcM_GetPosition_p(daPy_getPlayerActorClass())->y; - bool rv; - bool bVar5; - rv = false; - bVar5 = ((!mIsDarkWorld && daPy_py_c::checkNowWolf()) && dVar10 < 200.0f); - if (bVar5) { - f32 maxDist = pow(500.0f, 2.0f); - if (fopAcM_searchPlayerDistanceXZ2(this) < maxDist) { - rv = true; - } - } - return rv; + return !mIsDarkWorld && + daPy_py_c::checkNowWolf() && + dVar10 < 200.0f && + fopAcM_searchPlayerDistanceXZ2(this) < std::pow(500.0f, 2.0f); } /* 801598E8-8015994C 154228 0064+00 1/1 0/0 0/0 .text getNpcMdlDataP__10daNpcCd2_cFi */ |
