diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index 9e33580..db710dc 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -244,6 +244,23 @@ void CCharacterComponent::ComponentCloseFingers(CM2Model* model, COMP_HAND_SLOT } } +void CCharacterComponent::ComponentOpenFingers(CM2Model* model, COMP_HAND_SLOT handSlot) { + uint32_t firstBone; + uint32_t lastBone; + + if (handSlot == HAND_LEFT) { + firstBone = 13; + lastBone = 17; + } else { + firstBone = 8; + lastBone = 12; + } + + for (uint32_t boneId = firstBone; boneId <= lastBone; boneId++) { + model->UnsetBoneSequence(boneId, 0, 1); + } +} + HTEXTURE CCharacterComponent::CreateTexture(const char* fileName, CStatus* status) { auto texFlags = CGxTexFlags(GxTex_LinearMipNearest, 0, 0, 0, 0, 0, 1); return TextureCreate(fileName, texFlags, status, 0); diff --git a/src/component/CCharacterComponent.hpp b/src/component/CCharacterComponent.hpp index 80ca96e..5875c86 100644 --- a/src/component/CCharacterComponent.hpp +++ b/src/component/CCharacterComponent.hpp @@ -51,6 +51,7 @@ class CCharacterComponent { static void AddLink(CM2Model* parent, GEOCOMPONENTLINKS link, char const* modelPath, char const* texturePath, int32_t visualID, const ItemDisplayInfoRec* displayRec); static CCharacterComponent* AllocComponent(); static void ComponentCloseFingers(CM2Model* model, COMP_HAND_SLOT handSlot); + static void ComponentOpenFingers(CM2Model* model, COMP_HAND_SLOT handSlot); static HTEXTURE CreateTexture(const char* fileName, CStatus* status); static GEOCOMPONENTLINKS GetSheatheLink(SHEATHE_TYPE sheatheType, bool a2); static void Initialize();