ksys: Change isSensorLayer to getContactLayerType

The == 0 and == 1 comparisons suggest that the function actually
returns a ContactLayerType rather than a boolean
This commit is contained in:
Léo Lam 2021-12-15 11:21:13 +01:00
parent c0a24e1611
commit fb8f0c636e
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
5 changed files with 9 additions and 6 deletions

View File

@ -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

Can't render this file because it is too large.

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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);