mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-26 23:05:30 +03:00
Fix flipped viewmodels not swinging, etc. correctly
This commit is contained in:
parent
394501826c
commit
4eae5f4e16
@ -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 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user