diff --git a/data/uking_functions.csv b/data/uking_functions.csv index c326796a..4d983a19 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -79375,7 +79375,7 @@ Address,Quality,Size,Name 0x0000007100e93db0,U,000492, 0x0000007100e93f9c,U,000288,NPCBase::m2 0x0000007100e940bc,U,000092,NPCBase::m3 -0x0000007100e94118,O,000028,_ZN4ksys4phys13isSensorLayerENS0_12ContactLayerE +0x0000007100e94118,O,000028,_ZN4ksys4phys19getContactLayerTypeENS0_12ContactLayerE 0x0000007100e94134,O,000044,_ZN4ksys4phys20makeContactLayerMaskENS0_12ContactLayerE 0x0000007100e94160,O,000016,_ZN4ksys4phys19getContactLayerBaseENS0_16ContactLayerTypeE 0x0000007100e94170,O,000040,_ZN4ksys4phys32getContactLayerBaseRelativeValueENS0_12ContactLayerE diff --git a/src/KingSystem/Physics/RigidBody/physRigidBodyParam.h b/src/KingSystem/Physics/RigidBody/physRigidBodyParam.h index c72f2155..38c5731f 100644 --- a/src/KingSystem/Physics/RigidBody/physRigidBodyParam.h +++ b/src/KingSystem/Physics/RigidBody/physRigidBodyParam.h @@ -83,7 +83,8 @@ public: bool no_char_standing_on = false; bool isDynamicSensor() const { - return isSensorLayer(contact_layer) == 1 && motion_type == MotionType::Dynamic; + return getContactLayerType(contact_layer) == ContactLayerType::Sensor && + motion_type == MotionType::Dynamic; } }; KSYS_CHECK_SIZE_NX150(RigidBodyParamView, 0x90); diff --git a/src/KingSystem/Physics/System/physDefines.cpp b/src/KingSystem/Physics/System/physDefines.cpp index d5f2d123..beebbc5b 100644 --- a/src/KingSystem/Physics/System/physDefines.cpp +++ b/src/KingSystem/Physics/System/physDefines.cpp @@ -2,8 +2,10 @@ namespace ksys::phys { -u32 isSensorLayer(ContactLayer layer) { - return layer > ContactLayer::EntityEnd; +ContactLayerType getContactLayerType(ContactLayer layer) { + if (layer > ContactLayer::EntityEnd) + return ContactLayerType::Sensor; + return ContactLayerType::Entity; } u32 makeContactLayerMask(ContactLayer layer) { diff --git a/src/KingSystem/Physics/System/physDefines.h b/src/KingSystem/Physics/System/physDefines.h index 4664b7b2..c40db48c 100644 --- a/src/KingSystem/Physics/System/physDefines.h +++ b/src/KingSystem/Physics/System/physDefines.h @@ -164,7 +164,7 @@ enum class MotionType { Unknown = 3, }; -u32 isSensorLayer(ContactLayer layer); +ContactLayerType getContactLayerType(ContactLayer layer); u32 makeContactLayerMask(ContactLayer layer); u32 getContactLayerBase(ContactLayerType type); u32 getContactLayerBaseRelativeValue(ContactLayer layer); diff --git a/src/KingSystem/Physics/physInstanceSet.cpp b/src/KingSystem/Physics/physInstanceSet.cpp index 3742d678..9699d1ef 100644 --- a/src/KingSystem/Physics/physInstanceSet.cpp +++ b/src/KingSystem/Physics/physInstanceSet.cpp @@ -89,7 +89,7 @@ void InstanceSet::sub_7100FBA9BC() { } void InstanceSet::sub_7100FBACE0(phys::ContactLayer layer) { - bool sensor = phys::isSensorLayer(layer); + bool sensor = phys::getContactLayerType(layer) != ContactLayerType::Entity; for (auto& rb : mRigidBodySets) { rb.disableCollisionMaybe(layer);