@@ -139,7 +139,7 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
139
139
lua_classfunction (luaVM, " getTargetEnd" , " getPedTargetEnd" );
140
140
lua_classfunction (luaVM, " getTargetStart" , " getPedTargetStart" );
141
141
lua_classfunction (luaVM, " getWeaponMuzzlePosition" , " getPedWeaponMuzzlePosition" );
142
- lua_classfunction (luaVM, " getBonePosition" , " getPedBonePosition " );
142
+ lua_classfunction (luaVM, " getBonePosition" , OOP_GetPedBonePosition );
143
143
lua_classfunction (luaVM, " getCameraRotation" , " getPedCameraRotation" );
144
144
lua_classfunction (luaVM, " getWeaponSlot" , " getPedWeaponSlot" );
145
145
lua_classfunction (luaVM, " getWalkingStyle" , " getPedWalkingStyle" );
@@ -946,6 +946,35 @@ int CLuaPedDefs::GetPedBonePosition(lua_State* luaVM)
946
946
return 1 ;
947
947
}
948
948
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
+
949
978
int CLuaPedDefs::SetPedWeaponSlot (lua_State* luaVM)
950
979
{
951
980
// Verify the argument
0 commit comments