From 9da26df32f0d47498d22e6434bc650bcbf4bfc48 Mon Sep 17 00:00:00 2001 From: HeartPiece Date: Sun, 17 Jul 2022 15:23:54 +1000 Subject: [PATCH] fixed MapCollision match break --- include/Game/gameStages.h | 2 +- include/MapCollision.h | 2 +- src/plugProjectKandoU/gameStages.cpp | 20 ++++++++++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/include/Game/gameStages.h b/include/Game/gameStages.h index 8322c4ba0..a37b29de7 100644 --- a/include/Game/gameStages.h +++ b/include/Game/gameStages.h @@ -29,7 +29,7 @@ struct CaveOtakaraInfo { int get_index(int); void get_id(ID32&); - int getCaveIndex_FromID(ID32&); + CaveOtakara* getCaveIndex_FromID(ID32&); ID32* getCaveID_FromIndex(int); int m_count; // _00 diff --git a/include/MapCollision.h b/include/MapCollision.h index 85bb794e3..0c130ac7c 100644 --- a/include/MapCollision.h +++ b/include/MapCollision.h @@ -9,7 +9,7 @@ #include "Matrixf.h" struct MapCollision : public CNode { - virtual ~MapCollision(); // _08 + virtual ~MapCollision() {} // _08 virtual void getBoundBox(BoundBox& boundingBox) { m_divider->getBoundBox(boundingBox); } // _0C diff --git a/src/plugProjectKandoU/gameStages.cpp b/src/plugProjectKandoU/gameStages.cpp index fab6d9137..78cc88e92 100644 --- a/src/plugProjectKandoU/gameStages.cpp +++ b/src/plugProjectKandoU/gameStages.cpp @@ -210,11 +210,19 @@ inline void CaveOtakaraInfo::get_id(ID32&) * Address: ........ * Size: 000080 */ -inline int CaveOtakaraInfo::getCaveIndex_FromID(ID32&) -{ - // UNUSED FUNCTION - return 0; -} +inline CaveOtakara* CaveOtakaraInfo::getCaveIndex_FromID(ID32& id) { + CaveOtakara* caveNode; + for (int i = 0; i < m_count; i++) { + caveNode = (CaveOtakara*)m_owner.getChildAt(i); + + if ((caveNode->m_id == id.getID())) { + return caveNode; + } else { + continue; + } + } + return 0; +}; /* * --INFO-- @@ -1103,7 +1111,7 @@ lbl_801AE170: * Size: 000060 * AUTOGEN */ -MapCollision::~MapCollision() { } +// MapCollision::~MapCollision() { } namespace Game {