@@ -139,7 +139,7 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
139139 lua_classfunction (luaVM, " getTargetEnd" , " getPedTargetEnd" );
140140 lua_classfunction (luaVM, " getTargetStart" , " getPedTargetStart" );
141141 lua_classfunction (luaVM, " getWeaponMuzzlePosition" , " getPedWeaponMuzzlePosition" );
142- lua_classfunction (luaVM, " getBonePosition" , " getPedBonePosition " );
142+ lua_classfunction (luaVM, " getBonePosition" , OOP_GetPedBonePosition );
143143 lua_classfunction (luaVM, " getCameraRotation" , " getPedCameraRotation" );
144144 lua_classfunction (luaVM, " getWeaponSlot" , " getPedWeaponSlot" );
145145 lua_classfunction (luaVM, " getWalkingStyle" , " getPedWalkingStyle" );
@@ -946,6 +946,35 @@ int CLuaPedDefs::GetPedBonePosition(lua_State* luaVM)
946946 return 1 ;
947947}
948948
949+ int CLuaPedDefs::OOP_GetPedBonePosition (lua_State* luaVM)
950+ {
951+ // Verify the argument
952+ CClientPed* pPed = NULL ;
953+ unsigned char ucBone = 0 ;
954+ CScriptArgReader argStream (luaVM);
955+ argStream.ReadUserData (pPed);
956+ argStream.ReadNumber (ucBone);
957+
958+ if (!argStream.HasErrors ())
959+ {
960+ if (ucBone <= BONE_RIGHTFOOT)
961+ {
962+ eBone bone = (eBone)ucBone;
963+ CVector vecPosition;
964+ if (CStaticFunctionDefinitions::GetPedBonePosition (*pPed, bone, vecPosition))
965+ {
966+ lua_pushvector (luaVM, vecPosition);
967+ return 1 ;
968+ }
969+ }
970+ }
971+ else
972+ m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
973+
974+ lua_pushboolean (luaVM, false );
975+ return 1 ;
976+ }
977+
949978int CLuaPedDefs::SetPedWeaponSlot (lua_State* luaVM)
950979{
951980 // Verify the argument
0 commit comments