From 7c983ef0c70e50f5d96eeafefba89ae027183498 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Fri, 9 Feb 2024 18:40:59 -0500 Subject: [PATCH] d_cc_mass_s OK, d_cc_s work --- configure.py | 2 +- include/SSystem/SComponent/c_m3d_g_cps.h | 11 +- include/d/d_cc_mass_s.h | 32 +++- src/d/d_cc_mass_s.cpp | 195 +++++++++++++++++++---- src/d/d_cc_s.cpp | 119 ++++++++++++-- 5 files changed, 307 insertions(+), 52 deletions(-) diff --git a/configure.py b/configure.py index c196df4f9..eb8c040be 100644 --- a/configure.py +++ b/configure.py @@ -398,7 +398,7 @@ config.libs = [ Object(NonMatching, "d/d_bg_w_hf.cpp"), Object(NonMatching, "d/d_bg_w_sv.cpp"), Object(Matching, "d/d_cc_d.cpp"), - Object(NonMatching, "d/d_cc_mass_s.cpp"), + Object(Matching, "d/d_cc_mass_s.cpp"), Object(NonMatching, "d/d_cc_s.cpp"), Object(Matching, "d/d_cc_uty.cpp"), Object(NonMatching, "d/d_cam_param.cpp"), diff --git a/include/SSystem/SComponent/c_m3d_g_cps.h b/include/SSystem/SComponent/c_m3d_g_cps.h index 4c9610e65..c25d05a92 100644 --- a/include/SSystem/SComponent/c_m3d_g_cps.h +++ b/include/SSystem/SComponent/c_m3d_g_cps.h @@ -18,18 +18,25 @@ public: cM3dGCps(void) {} virtual ~cM3dGCps(void) {} - void Set(const cXyz&, const cXyz&, f32); + void Set(const cXyz& start, const cXyz& end, f32 radius) { + SetStartEnd(start, end); + SetR(radius); + } void Set(const cM3dGCpsS& src) { SetStartEnd(src.mStart, src.mEnd); SetR(src.mRadius); } - void SetCps(const cM3dGCps&); + void SetCps(const cM3dGCps& cps) { + Set(cps.mStart, cps.mEnd, cps.mRadius); + } bool Cross(cM3dGCps const* cps, cXyz* xyz) const { return cM3d_Cross_CpsCps(*this, *cps, xyz); } bool Cross(cM3dGCyl const* cyl, cXyz* xyz) const { return cM3d_Cross_CpsCyl(*this, *cyl, xyz); } bool Cross(cM3dGSph const* sph, cXyz* xyz) const { return cM3d_Cross_CpsSph(*this, *sph, xyz); } bool Cross(cM3dGTri const& tri, cXyz* xyz) const { return cM3d_Cross_CpsTri(*this, tri, xyz); } + f32 GetR() const { return mRadius; } void SetR(f32 r) { mRadius = r; } + void NearPos(cXyz, cXyz*) const {} }; // Size = 0x20 STATIC_ASSERT(0x20 == sizeof(cM3dGCps)); diff --git a/include/d/d_cc_mass_s.h b/include/d/d_cc_mass_s.h index 70374eacb..98e8670f3 100644 --- a/include/d/d_cc_mass_s.h +++ b/include/d/d_cc_mass_s.h @@ -17,13 +17,23 @@ public: public: dCcMassS_Obj() {} virtual ~dCcMassS_Obj() {} - void Set(cCcD_Obj* p_obj, u8 priority, dCcMassS_ObjCallback callback); - void Clear(); - cCcD_Obj* GetObj() { return mpObj; } + cCcD_Obj* GetObj() const { return mpObj; } u8 GetPriority() const { return mPriority; } - dCcMassS_ObjCallback GetCallback() const { return mpCallback; } - cCcD_DivideInfo& GetDivideInfo() { return mDivideInfo; } + dCcMassS_ObjCallback GetAreaCheckFunc() const { return mpCallback; } + cCcD_DivideInfo* GetPDivideInfo() { return &mDivideInfo; } + + void Clear() { + mpObj = NULL; + mPriority = 5; + mpCallback = NULL; + mDivideInfo.Set(0); + } + void Set(cCcD_Obj* p_obj, u8 priority, dCcMassS_ObjCallback callback) { + mpObj = p_obj; + mPriority = priority; + mpCallback = callback; + } }; // Size = 0x18 STATIC_ASSERT(0x18 == sizeof(dCcMassS_Obj)); @@ -37,12 +47,20 @@ private: public: virtual ~dCcMassS_HitInf() {} - void ClearPointer(); void SetAreaHitObj(cCcD_Obj* obj) { mpArea = obj; } void SetCoHitObj(cCcD_Obj* obj) { mpCoObj = obj; } void SetAtHitObj(cCcD_Obj* obj) { mpAtObj = obj; } void SetCoHitLen(f32 len) { mCoHitLen = len; } cCcD_Obj* GetAtHitObj() const { return mpAtObj; } + + void ClearPointer() { + mpArea = NULL; + mpAtObj = NULL; + mpCoObj = NULL; + mCoHitLen = 0.0f; + } + void GetCoHitLen() const {} + void GetCoHitObj() const {} }; class dCcMassS_Mng { @@ -81,7 +99,7 @@ public: void Set(cCcD_Obj* p_obj, u8 priority); void SetAreaChk(cCcD_Obj*, u8, void (*)(fopAc_ac_c*, cXyz*, u32)); void SetCam(cM3dGCps const& cps); - u8 GetResultCam() const; + u32 GetResultCam() const; void GetCamTopPos(Vec* p_out); }; diff --git a/src/d/d_cc_mass_s.cpp b/src/d/d_cc_mass_s.cpp index 55e9be7fe..58817a9ef 100644 --- a/src/d/d_cc_mass_s.cpp +++ b/src/d/d_cc_mass_s.cpp @@ -4,7 +4,10 @@ // #include "d/d_cc_mass_s.h" +#include "d/d_cc_d.h" #include "JSystem/JUtility/JUTAssert.h" +#include "SSystem/SComponent/c_math.h" +#include "f_op/f_op_actor.h" /* 800AC810-800AC920 .text __ct__12dCcMassS_MngFv */ dCcMassS_Mng::dCcMassS_Mng() { @@ -26,41 +29,45 @@ void dCcMassS_Mng::Ct() { /* 800AC96C-800ACCB8 .text Prepare__12dCcMassS_MngFv */ void dCcMassS_Mng::Prepare() { - /* Nonmatching */ cM3dGAab area; area.ClearForMinMax(); + cCcD_ShapeAttr* attr; for (dCcMassS_Obj* mass = mMassObjs; mass < mMassObjs + mMassObjCount; mass++) { - cCcD_Obj* pobj = mass->mpObj; + cCcD_Obj* pobj = mass->GetObj(); JUT_ASSERT(61, pobj != 0); - cCcD_ShapeAttr* attr = pobj->GetShapeAttr(); + attr = pobj->GetShapeAttr(); attr->CalcAabBox(); area.SetMinMax(attr->GetWorkAab().mMin); area.SetMinMax(attr->GetWorkAab().mMax); } for (dCcMassS_Obj* mass = mMassAreas; mass < mMassAreas + mMassAreaCount; mass++) { - cCcD_Obj* parea = mass->mpObj; + cCcD_Obj* parea = mass->GetObj(); JUT_ASSERT(73, parea != 0); - cCcD_ShapeAttr* attr = parea->GetShapeAttr(); + attr = parea->GetShapeAttr(); attr->CalcAabBox(); area.SetMinMax(attr->GetWorkAab().mMin); area.SetMinMax(attr->GetWorkAab().mMax); } if (mFlag & 1) { mCpsAttr.CalcAabBox(); - cCcD_ShapeAttr* attr = &mCpsAttr; + attr = &mCpsAttr; area.SetMinMax(attr->GetWorkAab().mMin); area.SetMinMax(attr->GetWorkAab().mMax); } mDivideArea.SetArea(area); for (dCcMassS_Obj* mass = mMassObjs; mass < mMassObjs + mMassObjCount; mass++) { - cCcD_Obj* pobj = mass->mpObj; + cCcD_Obj* pobj = mass->GetObj(); JUT_ASSERT(93, pobj != 0); - mDivideArea.CalcDivideInfo(&mass->mDivideInfo, pobj->GetShapeAttr()->GetWorkAab(), 0); + cCcD_ShapeAttr* shape = pobj->GetShapeAttr(); + cCcD_DivideInfo* divideInfo = mass->GetPDivideInfo(); + mDivideArea.CalcDivideInfo(divideInfo, shape->GetWorkAab(), 0); } for (dCcMassS_Obj* mass = mMassAreas; mass < mMassAreas + mMassAreaCount; mass++) { - cCcD_Obj* parea = mass->mpObj; + cCcD_Obj* parea = mass->GetObj(); JUT_ASSERT(104, parea != 0); - mDivideArea.CalcDivideInfo(&mass->mDivideInfo, parea->GetShapeAttr()->GetWorkAab(), 0); + cCcD_ShapeAttr* shape = parea->GetShapeAttr(); + cCcD_DivideInfo* divideInfo = mass->GetPDivideInfo(); + mDivideArea.CalcDivideInfo(divideInfo, shape->GetWorkAab(), 0); } if (mFlag & 1) { mDivideArea.CalcDivideInfo(&mDivideInfo, mCpsAttr.GetWorkAab(), 0); @@ -76,25 +83,126 @@ void dCcMassS_Mng::Prepare() { } /* 800ACCB8-800AD17C .text Chk__12dCcMassS_MngFP4cXyzPP10fopAc_ac_cP15dCcMassS_HitInf */ -u32 dCcMassS_Mng::Chk(cXyz*, fopAc_ac_c**, dCcMassS_HitInf*) { - /* Nonmatching */ +u32 dCcMassS_Mng::Chk(cXyz* r29, fopAc_ac_c** r30, dCcMassS_HitInf* r31) { + cCcD_DivideInfo divideInfo; + u32 r26 = 0; + *r30 = NULL; + mCylAttr.SetC(*r29); + mCylAttr.CalcAabBox(); + mDivideArea.CalcDivideInfoOverArea(÷Info, mCylAttr.GetWorkAab()); + r31->ClearPointer(); + + if (field_0x128 & 8) { + for (dCcMassS_Obj* mass = mMassAreas; mass < mMassAreas + mMassAreaCount; mass++) { + if (!mass->GetPDivideInfo()->Chk(divideInfo)) { + continue; + } + + cCcD_Obj* pobj = mass->GetObj(); + JUT_ASSERT(174, pobj != 0); + cCcD_ShapeAttr* shape = pobj->GetShapeAttr(); + + f32 sp10; + if (pobj->ChkCoSet() && mCylAttr.CrossCo(*shape, &sp10)) { + r26 |= 0x04; + *r30 = pobj->GetStts()->GetAc(); + if (r31) { + r31->SetAreaHitObj(pobj); + } + dCcMassS_ObjCallback callback = mass->GetAreaCheckFunc(); + if (callback) { + callback(pobj->GetStts()->GetAc(), r29, mResultCamBit); + } + } + } + } + + for (dCcMassS_Obj* mass = mMassObjs; mass < mMassObjs + mMassObjCount; mass++) { + if (!mass->GetPDivideInfo()->Chk(divideInfo)) { + continue; + } + + cCcD_Obj* pobj = mass->GetObj(); + dCcD_GObjInf* inf = (dCcD_GObjInf*)pobj->GetGObjInf(); + JUT_ASSERT(214, pobj != 0); + cCcD_ShapeAttr* shape = pobj->GetShapeAttr(); + cXyz temp; + if (pobj->ChkAtSet() && !inf->ChkAtNoMass() && + mCylAttr.CrossAtTg(*shape, &temp) && (field_0x128 & 0x1) + ) { + r26 |= 0x01; + *r30 = pobj->GetStts()->GetAc(); + if (r31) { + r31->SetAtHitObj(pobj); + } + } + + f32 sp10; + if (pobj->ChkCoSet() && mCylAttr.CrossCo(*shape, &sp10) && (field_0x128 & 0x02)) { + r26 |= 0x02; + *r30 = pobj->GetStts()->GetAc(); + + if (field_0x128 & 0x10) { + Vec vec; + VECSubtract(&(*r30)->current.pos, r29, &vec); + vec.y = 0; + f32 vecMag = VECMag(&vec); + if (cM3d_IsZero(vecMag)) { + vec.x = 1; + } else { + VECScale(&vec, &vec, sp10 / vecMag); + } + pobj->GetStts()->PlusCcMove(vec.x, vec.y, vec.z); + } + + if (r31) { + r31->SetCoHitObj(pobj); + r31->SetCoHitLen(sp10); + } + } + } + + f32 temp; + if ((mFlag & 1) && mDivideInfo.Chk(divideInfo) && mCylAttr.CrossCo(mCpsAttr, &temp)) { + mResultCam |= 1; + mResultCam |= 1 << (mResultCamBit + 1); + + if ((mResultCam & 2) || (mResultCam & 8)) { + f32 plusH = r29->y + mCylAttr.GetH(); + cXyz sp1c; + sp1c.x = r29->x; + sp1c.y = plusH; + sp1c.z = r29->z; + + if (mCamTopPos.y < 20.0f + plusH) { + f32 startDist = VECSquareDistance(&sp1c, mCpsAttr.GetStartP()); + if (mCamTopDist > startDist) { + mCamTopDist = startDist; + mCamTopPos = sp1c; + } + } + if (mCamBottomPos.y < 20.0f + plusH) { + f32 endDist = VECSquareDistance(&sp1c, mCpsAttr.GetEndP()); + if (mCamBottomDist > endDist) { + mCamBottomDist = endDist; + mCamBottomPos = sp1c; + } + } + } + } + + return r26; } /* 800AD17C-800AD234 .text Clear__12dCcMassS_MngFv */ void dCcMassS_Mng::Clear() { mMassObjCount = 0; mMassAreaCount = 0; - for (int i = 0; i < 5; i++) { - mMassObjs[i].mpObj = NULL; - mMassObjs[i].mPriority = 5; - mMassObjs[i].mpCallback = NULL; - mMassObjs[i].mDivideInfo.mRangeBits = 0; + for (int i = 0; i < ARRAY_SIZE(mMassObjs); i++) { + mMassObjs[i].Clear(); } - for (int i = 0; i < 2; i++) { - mMassAreas[i].mpObj = NULL; - mMassAreas[i].mPriority = 5; - mMassAreas[i].mpCallback = NULL; - mMassAreas[i].mDivideInfo.mRangeBits = 0; + for (int i = 0; i < ARRAY_SIZE(mMassAreas); i++) { + mMassAreas[i].Clear(); } mCylAttr.SetR(0.0f); mCylAttr.SetH(0.0f); @@ -103,26 +211,49 @@ void dCcMassS_Mng::Clear() { } /* 800AD234-800AD310 .text Set__12dCcMassS_MngFP8cCcD_ObjUc */ -void dCcMassS_Mng::Set(cCcD_Obj*, u8) { - /* Nonmatching */ +void dCcMassS_Mng::Set(cCcD_Obj* i_obj, u8 i_priority) { + if (mMassObjCount >= 5) { + for (int i = 0; i < (s32)ARRAY_SIZE(mMassObjs); i++) { + int priority = mMassObjs[i].GetPriority(); + if (priority > i_priority || (priority == i_priority && cM_rndF(1.0f) < 0.5f)) { + mMassObjs[i].Set(i_obj, i_priority, NULL); + return; + } + } + } else { + mMassObjs[mMassObjCount].Set(i_obj, i_priority, NULL); + mMassObjCount++; + } } /* 800AD310-800AD384 .text SetAreaChk__12dCcMassS_MngFP8cCcD_ObjUcPFP10fopAc_ac_cP4cXyzUl_v */ -void dCcMassS_Mng::SetAreaChk(cCcD_Obj*, u8, void (*)(fopAc_ac_c*, cXyz*, u32)) { - /* Nonmatching */ +void dCcMassS_Mng::SetAreaChk(cCcD_Obj* p_obj, u8 i_priority, dCcMassS_ObjCallback callback) { + if (mMassAreaCount >= 2) { + for (int i = 0; i < (s32)ARRAY_SIZE(mMassAreas); i++) { + if (mMassAreas[i].GetPriority() > i_priority) { + mMassAreas[i].Set(p_obj, i_priority, callback); + return; + } + } + } else { + mMassAreas[mMassAreaCount].Set(p_obj, i_priority, callback); + mMassAreaCount++; + } } /* 800AD384-800AD3D4 .text SetCam__12dCcMassS_MngFRC8cM3dGCps */ -void dCcMassS_Mng::SetCam(const cM3dGCps&) { - /* Nonmatching */ +void dCcMassS_Mng::SetCam(const cM3dGCps& cps) { + mCpsAttr.SetCps(cps); + mFlag |= 0x1; + mResultCam = 0; } /* 800AD3D4-800AD3DC .text GetResultCam__12dCcMassS_MngCFv */ -u8 dCcMassS_Mng::GetResultCam() const { - /* Nonmatching */ +u32 dCcMassS_Mng::GetResultCam() const { + return mResultCam; } /* 800AD3DC-800AD3F8 .text GetCamTopPos__12dCcMassS_MngFP3Vec */ -void dCcMassS_Mng::GetCamTopPos(Vec*) { - /* Nonmatching */ +void dCcMassS_Mng::GetCamTopPos(Vec* outPos) { + *outPos = mCamTopPos; } diff --git a/src/d/d_cc_s.cpp b/src/d/d_cc_s.cpp index 582b5689c..a636dee08 100644 --- a/src/d/d_cc_s.cpp +++ b/src/d/d_cc_s.cpp @@ -19,23 +19,86 @@ void dCcS::Dt() { } /* 800AD604-800AD748 .text ChkShieldFrontRange__4dCcSFP8cCcD_ObjP8cCcD_Obj */ -bool dCcS::ChkShieldFrontRange(cCcD_Obj*, cCcD_Obj*) { - /* Nonmatching */ +bool dCcS::ChkShieldFrontRange(cCcD_Obj* obj1, cCcD_Obj* obj2) { + dCcD_GObjInf* inf1 = (dCcD_GObjInf*)obj1->GetGObjInf(); + if (inf1 == NULL) { return false; } + dCcD_Stts* stts1 = (dCcD_Stts*)inf1->GetStts(); + fopAc_ac_c* ac1 = stts1 == NULL ? NULL : stts1->GetAc(); + if (ac1 == NULL) { return false; } + dCcD_GObjInf* inf2 = (dCcD_GObjInf*)obj2->GetGObjInf(); + if (inf2 == NULL) { return false; } + dCcD_Stts* stts2 = (dCcD_Stts*)inf2->GetStts(); + fopAc_ac_c* ac2 = stts2 == NULL ? NULL : stts2->GetAc(); + if (ac2 == NULL) { return false; } + + cXyz delta; + VECSubtract(&ac1->mEyePos, &ac2->mEyePos, &delta); + f32 dist = PSVECMag(&delta); + if (cM3d_IsZero(dist)) { + return false; + } + PSVECNormalize(&delta, &delta); + s16 deltaAngle = cM_atan2s(delta.x, delta.z); + s16 shieldAngle = inf2->GetTgShieldFrontRangeYAngle() ? *inf2->GetTgShieldFrontRangeYAngle() : ac2->shape_angle.y; + if (cLib_distanceAngleS(deltaAngle, shieldAngle) > 0x4000) { + return false; + } + + return true; } /* 800AD748-800AD7D0 .text ChkShield__4dCcSFP8cCcD_ObjP8cCcD_ObjP12dCcD_GObjInfP12dCcD_GObjInf */ -bool dCcS::ChkShield(cCcD_Obj*, cCcD_Obj*, dCcD_GObjInf*, dCcD_GObjInf*) { - /* Nonmatching */ +bool dCcS::ChkShield(cCcD_Obj* obj1, cCcD_Obj* obj2, dCcD_GObjInf* inf1, dCcD_GObjInf* inf2) { + if (inf1->ChkAtNoGuard()) { + return false; + } + if (inf2->ChkTgShield()) { + if (inf2->ChkTgShieldFrontRange()) { + return ChkShieldFrontRange(obj1, obj2); + } else { + return true; + } + } else { + return false; + } } /* 800AD7D0-800AD86C .text CalcTgPlusDmg__4dCcSFP8cCcD_ObjP8cCcD_ObjP9cCcD_SttsP9cCcD_Stts */ -void dCcS::CalcTgPlusDmg(cCcD_Obj*, cCcD_Obj*, cCcD_Stts*, cCcD_Stts*) { - /* Nonmatching */ +void dCcS::CalcTgPlusDmg(cCcD_Obj* obj1, cCcD_Obj* obj2, cCcD_Stts* stts1, cCcD_Stts* stts2) { + dCcD_GObjInf* inf1 = (dCcD_GObjInf*)obj1->GetGObjInf(); + dCcD_GObjInf* inf2 = (dCcD_GObjInf*)obj2->GetGObjInf(); + if (!ChkShield(obj1, obj2, inf1, inf2)) { + int atp = obj1->GetAtAtp(); + if (stts2->GetDmg() < atp) { + stts2->PlusDmg(atp); + } + } } /* 800AD86C-800AD8EC .text ChkAtTgHitAfterCross__4dCcSFbbPC12cCcD_GObjInfPC12cCcD_GObjInfP9cCcD_SttsP9cCcD_SttsP10cCcD_GSttsP10cCcD_GStts */ -bool dCcS::ChkAtTgHitAfterCross(bool, bool, const cCcD_GObjInf*, const cCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*, cCcD_GStts*, cCcD_GStts*) { - /* Nonmatching */ +bool dCcS::ChkAtTgHitAfterCross(bool r4, bool r5, const cCcD_GObjInf* r6, const cCcD_GObjInf* r7, + cCcD_Stts* r8, cCcD_Stts* r9, cCcD_GStts* r10, cCcD_GStts* sp8) { + dCcD_GStts* r10_d = (dCcD_GStts*)r10; + dCcD_GStts* r9_d = (dCcD_GStts*)r9; + dCcD_GStts* r8_d = (dCcD_GStts*)r8; + dCcD_GStts* sp8_d = (dCcD_GStts*)sp8; + dCcD_GObjInf* r6_d = (dCcD_GObjInf*)r6; + dCcD_GObjInf* r7_d = (dCcD_GObjInf*)r7; + unsigned int r11 = r8->GetApid(); + unsigned int r3 = r9->GetApid(); + if (r4) { + r10_d->SetAtApid(r3); + if (r6_d->ChkAtNoConHit() && r10_d->GetAtOldApid() == r9_d->GetAtOldApid()) { + return true; + } + } + if (r5) { + sp8_d->SetTgApid(r11); + if (r7_d->ChkTgNoConHit() && !r6_d->ChkAtStopNoConHit() && sp8_d->GetTgOldApid() == r8_d->GetAtOldApid()) { + return true; + } + } + return false; } /* 800AD8EC-800ADA30 .text SetCoGObjInf__4dCcSFbbP12cCcD_GObjInfP12cCcD_GObjInfP9cCcD_SttsP9cCcD_SttsP10cCcD_GSttsP10cCcD_GStts */ @@ -43,9 +106,45 @@ void dCcS::SetCoGObjInf(bool, bool, cCcD_GObjInf*, cCcD_GObjInf*, cCcD_Stts*, cC /* Nonmatching */ } +static u8 rank_tbl[11][11] = { + { 0, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 }, + { 0, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100 }, + { 0, 0, 50, 75, 90, 100, 100, 100, 100, 100, 100 }, + { 0, 0, 25, 50, 75, 90, 100, 100, 100, 100, 100 }, + { 0, 0, 10, 25, 50, 75, 90, 100, 100, 100, 100 }, + { 0, 0, 0, 10, 25, 50, 75, 90, 100, 100, 100 }, + { 0, 0, 0, 0, 10, 25, 50, 75, 90, 100, 100 }, + { 0, 0, 0, 0, 0, 10, 25, 50, 75, 100, 100 }, + { 0, 0, 0, 0, 0, 0, 10, 25, 50, 100, 100 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 100 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, +}; + /* 800ADA30-800ADAD4 .text GetRank__4dCcSFUc */ -int dCcS::GetRank(u8) { - /* Nonmatching */ +int dCcS::GetRank(u8 weight) { + if (weight == 0xFF) { + return 10; + } else if (weight == 0xFE) { + return 9; + } else if (weight >= 0xD9) { + return 8; + } else if (weight >= 0xB5) { + return 7; + } else if (weight >= 0x91) { + return 6; + } else if (weight >= 0x6D) { + return 5; + } else if (weight >= 0x49) { + return 4; + } else if (weight >= 0x25) { + return 3; + } else if (weight >= 0x02) { + return 2; + } else if (weight == 0x01) { + return 1; + } else { + return 0; + } } /* 800ADAD4-800ADEF0 .text SetPosCorrect__4dCcSFP8cCcD_ObjP4cXyzP8cCcD_ObjP4cXyzf */