mirror of
https://github.com/rehlds/rehlds.git
synced 2025-04-16 22:32:30 +03:00
GetBonePosition: Added bone index bounds check
This commit is contained in:
parent
8841ba4aec
commit
918612fa23
@ -881,6 +881,15 @@ void EXT_FUNC AnimationAutomove(const edict_t *pEdict, float flTime)
|
|||||||
void EXT_FUNC GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles)
|
void EXT_FUNC GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles)
|
||||||
{
|
{
|
||||||
pstudiohdr = (studiohdr_t *)Mod_Extradata(g_psv.models[pEdict->v.modelindex]);
|
pstudiohdr = (studiohdr_t *)Mod_Extradata(g_psv.models[pEdict->v.modelindex]);
|
||||||
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
if (!pstudiohdr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (iBone < 0 || iBone >= pstudiohdr->numbones)
|
||||||
|
return; // invalid bone
|
||||||
|
#endif
|
||||||
|
|
||||||
g_pSvBlendingAPI->SV_StudioSetupBones(
|
g_pSvBlendingAPI->SV_StudioSetupBones(
|
||||||
g_psv.models[pEdict->v.modelindex],
|
g_psv.models[pEdict->v.modelindex],
|
||||||
pEdict->v.frame,
|
pEdict->v.frame,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user