Fix crash when custom SV_StudioSetupBones exported to the engine (#40)

* Fix crash when custom SV_StudioSetupBones exported to the engine
This commit is contained in:
Alibek Omarov 2016-06-12 16:55:45 +03:00 committed by s1lentq
parent e6df6ef577
commit 4f1ca61628
2 changed files with 6 additions and 1 deletions

View File

@ -1062,7 +1062,6 @@ void SV_StudioSetupBones(model_t *pModel, float frame, int sequence, const vec_t
/*static */float q3[MAXSTUDIOBONES][4], q4[MAXSTUDIOBONES][4];
float_precision s, t;
s = GetPlayerYaw(pEdict);
t = GetPlayerPitch(pEdict);

View File

@ -8030,6 +8030,9 @@ void CBasePlayer::ResetStamina()
float_precision GetPlayerPitch(const edict_t *pEdict)
{
if( !pEdict )
return 0.0f;
entvars_t *pev = VARS(const_cast<edict_t *>(pEdict));
CBasePlayer *pPlayer = dynamic_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
@ -8041,6 +8044,9 @@ float_precision GetPlayerPitch(const edict_t *pEdict)
float_precision GetPlayerYaw(const edict_t *pEdict)
{
if( !pEdict )
return 0.0f;
entvars_t *pev = VARS(const_cast<edict_t *>(pEdict));
CBasePlayer *pPlayer = dynamic_cast<CBasePlayer *>(CBasePlayer::Instance(pev));