diff --git a/src/KingSystem/Physics/System/physCollisionInfo.h b/src/KingSystem/Physics/System/physCollisionInfo.h index 5f6e0694..ac4384a7 100644 --- a/src/KingSystem/Physics/System/physCollisionInfo.h +++ b/src/KingSystem/Physics/System/physCollisionInfo.h @@ -74,12 +74,12 @@ inline void CollisionInfoBase::enableLayer(ContactLayer layer) { } inline void CollisionInfoBase::disableLayer(ContactLayer layer) { - getLayerMask(getContactLayerType(layer)).resetBit(int(getContactLayerBaseRelativeValue(layer))); + getLayerMask(getContactLayerType(layer)).resetBit(getContactLayerBaseRelativeValue(layer)); } inline bool CollisionInfoBase::isLayerEnabled(ContactLayer layer) const { const auto& mask = getLayerMask(getContactLayerType(layer)); - return mask.isOnBit(int(getContactLayerBaseRelativeValue(layer))); + return mask.isOnBit(getContactLayerBaseRelativeValue(layer)); } inline void CollisionInfoBase::lock() { diff --git a/src/KingSystem/Physics/System/physContactPointInfo.h b/src/KingSystem/Physics/System/physContactPointInfo.h index 2d6a2445..450a2de0 100644 --- a/src/KingSystem/Physics/System/physContactPointInfo.h +++ b/src/KingSystem/Physics/System/physContactPointInfo.h @@ -41,13 +41,13 @@ public: bool isLayerSubscribed(ContactLayer layer) const { const auto type = getContactLayerType(layer); - return mSubscribedLayers[int(type)].isOnBit(int(getContactLayerBaseRelativeValue(layer))); + return mSubscribedLayers[int(type)].isOnBit(getContactLayerBaseRelativeValue(layer)); } // TODO: rename bool isLayerInMask2(ContactLayer layer) const { const auto type = getContactLayerType(layer); - return mLayerMask2[int(type)].isOnBit(int(getContactLayerBaseRelativeValue(layer))); + return mLayerMask2[int(type)].isOnBit(getContactLayerBaseRelativeValue(layer)); } void setLayerMasks(const LayerMaskBuilder& builder) { diff --git a/src/KingSystem/Physics/physDefines.cpp b/src/KingSystem/Physics/physDefines.cpp index a9d50e1d..079b5c72 100644 --- a/src/KingSystem/Physics/physDefines.cpp +++ b/src/KingSystem/Physics/physDefines.cpp @@ -20,7 +20,7 @@ u32 getContactLayerBase(ContactLayerType type) { return FirstSensor; } -u32 getContactLayerBaseRelativeValue(ContactLayer layer) { +int getContactLayerBaseRelativeValue(ContactLayer layer) { return layer - (layer < FirstSensor ? FirstEntity : FirstSensor); } diff --git a/src/KingSystem/Physics/physDefines.h b/src/KingSystem/Physics/physDefines.h index 565600ed..d9ba068c 100644 --- a/src/KingSystem/Physics/physDefines.h +++ b/src/KingSystem/Physics/physDefines.h @@ -378,7 +378,7 @@ union SensorQueryCollisionMask { ContactLayerType getContactLayerType(ContactLayer layer); u32 makeContactLayerMask(ContactLayer layer); u32 getContactLayerBase(ContactLayerType type); -u32 getContactLayerBaseRelativeValue(ContactLayer layer); +int getContactLayerBaseRelativeValue(ContactLayer layer); const char* contactLayerToText(ContactLayer layer); ContactLayer contactLayerFromText(const sead::SafeString& text);