repair radarinfo

This commit is contained in:
EpochFlame 2024-06-29 21:04:33 -04:00
parent ed2da772fe
commit b6cb1e6d93
3 changed files with 26 additions and 27 deletions

View File

@ -83,10 +83,10 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/collinfo.cpp">collinfo.cpp</a> | 43044 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/cellPyramid.cpp">cellPyramid.cpp</a> | 48067 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/fakePiki.cpp">fakePiki.cpp</a> | 50426 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiFormation.cpp">aiFormation.cpp</a> | 53253 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pelletState.cpp">pelletState.cpp</a> | 63252 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemUjamushi.cpp">itemUjamushi.cpp</a> | 64495 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemPlant.cpp">itemPlant.cpp</a> | 73525 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/baseGameSection.cpp">baseGameSection.cpp</a> | 86610 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemPlant.cpp">itemPlant.cpp</a> | 73525 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/baseGameSection.cpp">baseGameSection.cpp</a> | 86433 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiPrimitives.cpp">aiPrimitives.cpp</a> | 117085 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pelletMgr.cpp">pelletMgr.cpp</a> | 134788 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/navi.cpp">navi.cpp</a> | 148886 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pikiState.cpp">pikiState.cpp</a> | 155487 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviState.cpp">naviState.cpp</a> | 163046 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_Zukan.cpp">singleGS_Zukan.cpp</a> | 163810 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/navi.cpp">navi.cpp</a> | 148896 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pikiState.cpp">pikiState.cpp</a> | 155487 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviState.cpp">naviState.cpp</a> | 163231 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_Zukan.cpp">singleGS_Zukan.cpp</a> | 163810 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameMapParts.cpp">gameMapParts.cpp</a> | 164131 | | |
### <section id="plugProjectKonoU">plugProjectKonoU</section>
@ -181,7 +181,7 @@
| File | Size (bytes) | File | Size (bytes) |
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_CreaturePrm.cpp">PSMainSide_CreaturePrm.cpp</a> | 2600 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_ObjCalc.cpp">PSMainSide_ObjCalc.cpp</a> | 7679 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Sound.cpp">PSMainSide_Sound.cpp</a> | 11782 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Director.cpp">PSMainSide_Director.cpp</a> | 29410 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Sound.cpp">PSMainSide_Sound.cpp</a> | 11782 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Director.cpp">PSMainSide_Director.cpp</a> | 29610 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Se.cpp">PSMainSide_Se.cpp</a> | 45066 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Scene.cpp">PSMainSide_Scene.cpp</a> | 49638 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_ObjSound.cpp">PSMainSide_ObjSound.cpp</a> | 74677 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Factory.cpp">PSMainSide_Factory.cpp</a> | 88157 |

View File

@ -172,7 +172,7 @@ bool Radar::Mgr::detach(Game::TPositionObject* obj)
* @note Address: 0x8021E774
* @note Size: 0x1E0
*/
int Radar::Mgr::calcNearestTreasure(Vector3f& naviPos, f32 searchDist, Vector3f& treasurePos, f32& nearestDistanceSquared)
int Radar::Mgr::calcNearestTreasure(Vector3f& naviPos, f32 searchDist, Vector3f& treasurePos, f32& dist2)
{
if (mFuefukiCount > 0) {
if (mFuefukiTimer > 0) {
@ -183,44 +183,41 @@ int Radar::Mgr::calcNearestTreasure(Vector3f& naviPos, f32 searchDist, Vector3f&
return 3; // Fuefuki active, timer expired
}
Point* closestPoint = nullptr;
int treasureCount = 0;
f32 closestDistance = searchDist;
Point* retPoint = nullptr;
int ret = 0;
f32 dist = searchDist;
FOREACH_NODE(Point, mPointNode1.mChild, cPoint)
{
if (cPoint->mObjType != MAP_TREASURE && cPoint->mObjType != MAP_SWALLOWED_TREASURE && cPoint->mObjType != MAP_UPGRADE) {
continue; // Skip if not a treasure
}
treasureCount++;
Game::Creature* currentTreasure = static_cast<Game::Pellet*>(cPoint->mObject);
// Stripped debug code
if (!currentTreasure->isTeki()) {
currentTreasure->isPellet();
ret++;
Game::Creature* cObj = static_cast<Game::Pellet*>(cPoint->mObject);
if (!cObj->isTeki()) {
cObj->isPellet();
}
Vector3f nearestTreasurePos = currentTreasure->getPosition();
Sys::Sphere boundingSphere;
Vector2f diff = Vector2f(nearestTreasurePos.x, nearestTreasurePos.z);
Vector3f objPos = cObj->getPosition();
Sys::Sphere test;
Vector2f diff = Vector2f(objPos.x, objPos.z);
diff.x -= naviPos.x;
diff.y -= naviPos.z;
currentTreasure->getBoundingSphere(boundingSphere);
cObj->getBoundingSphere(test);
f32 currentDistance = _lenVec2D(diff) - boundingSphere.mRadius;
if (currentDistance <= closestDistance) {
closestDistance = currentDistance;
closestPoint = cPoint;
nearestTreasurePos = currentTreasure->getPosition();
nearestDistanceSquared = currentDistance;
f32 cDist = _lenVec2D(diff) - test.mRadius;
if (cDist <= dist) {
dist = cDist;
retPoint = cPoint;
treasurePos = cObj->getPosition();
dist2 = cDist;
}
}
if (closestPoint != nullptr) {
if (retPoint != nullptr) {
return 2; // Found treasure
}
return treasureCount > 0; // No treasure found
return ret > 0; // No treasure found
}
/**

View File

@ -1055,3 +1055,5 @@ You have 4877 out of 10000 Pokos and 116 out of 201 treasures.",2024-06-25 17:51
You have 4883 out of 10000 Pokos and 116 out of 201 treasures.",2024-06-25 18:18:54.264891
4889,2274828,0.4889630019396641,116,412742,0.5789977218400351,"
You have 4889 out of 10000 Pokos and 116 out of 201 treasures.",2024-06-28 14:31:03.505564
4888,2274524,0.4888976586466372,116,412742,0.5789977218400351,"
You have 4888 out of 10000 Pokos and 116 out of 201 treasures.",2024-06-29 21:04:12.894883

1 code_count_in_pokos code_completion_in_bytes code_completion_in_percentage data_count_in_treasures data_completion_in_bytes data_completion_in_percentage sentence created_at
1055
1056
1057
1058
1059