From a63b816ffcc203047307c2891b760342b1d57557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 25 Mar 2022 22:20:19 +0100 Subject: [PATCH] ksys/phys: Fix misleading name for StaticCompound::disableCollision --- data/uking_functions.csv | 2 +- src/KingSystem/Map/mapPlacementMap.cpp | 4 ++-- src/KingSystem/Physics/StaticCompound/physStaticCompound.cpp | 4 ++-- src/KingSystem/Physics/StaticCompound/physStaticCompound.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 2eff34dd..9782cab7 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -84217,7 +84217,7 @@ Address,Quality,Size,Name 0x0000007100fcaa60,O,000136,_ZN4ksys4phys14StaticCompound26removeFromWorldImmediatelyEv 0x0000007100fcaae8,O,000076,_ZN4ksys4phys14StaticCompound12setMapObjectEjjPNS_3map6ObjectE 0x0000007100fcab34,O,000072,_ZNK4ksys4phys14StaticCompound12getMapObjectEi -0x0000007100fcab7c,O,000176,_ZN4ksys4phys14StaticCompound16disableCollisionEib +0x0000007100fcab7c,O,000176,_ZN4ksys4phys14StaticCompound18setInstanceEnabledEib 0x0000007100fcac2c,O,000112,_ZN4ksys4phys14StaticCompound14processUpdatesEv 0x0000007100fcac9c,O,000112,_ZN4ksys4phys14StaticCompound24recomputeTransformMatrixEv 0x0000007100fcad0c,O,000328,_ZN4ksys4phys14StaticCompound20applyExtraTransformsERKN4sead8Matrix34IfEE diff --git a/src/KingSystem/Map/mapPlacementMap.cpp b/src/KingSystem/Map/mapPlacementMap.cpp index 44defe6c..93da597a 100644 --- a/src/KingSystem/Map/mapPlacementMap.cpp +++ b/src/KingSystem/Map/mapPlacementMap.cpp @@ -105,7 +105,7 @@ void PlacementMap::updateObjectCollisionAndId(int index, Object* obj) { obj->setFlags0(Object::Flag0::_200000); disable = true; } - sc->disableCollision(idx, disable); + sc->setInstanceEnabled(idx, disable); } bool PlacementMap::parseStaticMap_(sead::Heap* heap, u8* data) { @@ -255,7 +255,7 @@ void PlacementMap::doDisableObjStaticCompound(Object* obj, bool disable) { auto* resource = mRes[idx].mRes.getResource(); if (auto* sc = sead::DynamicCast(resource)) { s16 sc_id = obj->getStaticCompoundActorId(); - sc->disableCollision(sc_id, disable); + sc->setInstanceEnabled(sc_id, disable); } } diff --git a/src/KingSystem/Physics/StaticCompound/physStaticCompound.cpp b/src/KingSystem/Physics/StaticCompound/physStaticCompound.cpp index 97fc491e..47b3620f 100644 --- a/src/KingSystem/Physics/StaticCompound/physStaticCompound.cpp +++ b/src/KingSystem/Physics/StaticCompound/physStaticCompound.cpp @@ -177,7 +177,7 @@ map::Object* StaticCompound::getMapObject(int shape_idx) const { return mMapObjects[idx]; } -bool StaticCompound::disableCollision(int actor_idx, bool x) { +bool StaticCompound::setInstanceEnabled(int actor_idx, bool enabled) { const int start = mStaticCompoundInfo->getShapeInfoStart(actor_idx); const int end = mStaticCompoundInfo->getShapeInfoEnd(actor_idx); for (int i = start; i <= end; ++i) { @@ -189,7 +189,7 @@ bool StaticCompound::disableCollision(int actor_idx, bool x) { const auto type = static_cast(info->m_BodyLayerType); const auto instance_id = info->m_InstanceId; - mFieldBodyGroups[group].setInstanceEnabled(type, instance_id, x); + mFieldBodyGroups[group].setInstanceEnabled(type, instance_id, enabled); } return true; } diff --git a/src/KingSystem/Physics/StaticCompound/physStaticCompound.h b/src/KingSystem/Physics/StaticCompound/physStaticCompound.h index 9864894f..78c7f5cf 100644 --- a/src/KingSystem/Physics/StaticCompound/physStaticCompound.h +++ b/src/KingSystem/Physics/StaticCompound/physStaticCompound.h @@ -36,7 +36,7 @@ public: int setMapObject(u32 hash_id, u32 srt_hash, map::Object* object); map::Object* getMapObject(int shape_idx) const; - bool disableCollision(int actor_idx, bool x); + bool setInstanceEnabled(int actor_idx, bool enabled); void processUpdates(); void recomputeTransformMatrix();