MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / DetachObjectToBone

Method DetachObjectToBone

CryGame/ScriptObjectWeaponClass.cpp:813–843  ·  view source on GitHub ↗

------------------------------------------------------------------

Source from the content-addressed store, hash-verified

811//
812//------------------------------------------------------------------
813int CScriptObjectWeaponClass::DetachObjectToBone(IFunctionHandler *pH)
814{
815 char *boneName;
816 pH->GetParam(1,boneName);
817
818 int BAD_HANDLER = -1;
819 int nCookie;
820 ULONG_PTR boneHandler = BAD_HANDLER;
821
822 if (!pH->GetParamUDVal(2,boneHandler,nCookie))
823 {
824 boneHandler = BAD_HANDLER;
825 }
826 if (nCookie != USER_DATA_BONEHANDLER)
827 {
828 boneHandler = BAD_HANDLER;
829 }
830
831 if (m_pWeaponClass->GetCharacter())
832 {
833 if (boneHandler == -1)
834 {
835 m_pWeaponClass->GetCharacter()->AttachObjectToBone( NULL, boneName, false );
836 }
837 else
838 {
839 m_pWeaponClass->GetCharacter()->Detach( boneHandler );
840 }
841 }
842 return pH->EndFunction();
843}
844
845int CScriptObjectWeaponClass::CacheObject(IFunctionHandler *pH)
846{

Callers 1

DeselectWeaponMethod · 0.45

Calls 6

EndFunctionMethod · 0.80
GetParamMethod · 0.45
GetParamUDValMethod · 0.45
GetCharacterMethod · 0.45
AttachObjectToBoneMethod · 0.45
DetachMethod · 0.45

Tested by

no test coverage detected