mirror of
https://github.com/zeldaret/botw
synced 2026-08-01 08:07:52 -04:00
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:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user