Fix flipped viewmodels not swinging, etc. correctly

This commit is contained in:
Blixibon 2021-09-25 10:33:19 -05:00
parent 394501826c
commit 4eae5f4e16

View File

@ -424,6 +424,21 @@ void CBaseViewModel::CalcViewModelView( CBasePlayer *owner, const Vector& eyePos
g_ClientVirtualReality.OverrideViewModelTransform( vmorigin, vmangles, pWeapon && pWeapon->ShouldUseLargeViewModelVROverride() );
}
#ifdef MAPBASE
// Flip the view if we should be flipping
if (ShouldFlipViewModel())
{
Vector vecOriginDiff = (eyePosition - vmorigin);
QAngle angAnglesDiff = (eyeAngles - vmangles);
vmorigin.x = (eyePosition.x + vecOriginDiff.x);
vmorigin.y = (eyePosition.y + vecOriginDiff.y);
vmangles.y = (eyeAngles.y + angAnglesDiff.y);
vmangles.z = (eyeAngles.z + angAnglesDiff.z);
}
#endif
SetLocalOrigin( vmorigin );
SetLocalAngles( vmangles );