Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions cl_dll/StudioModelRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ void CStudioModelRenderer::StudioSetupBones(void)
if (IEngineStudio.IsHardware())
{
// i know this looks HORRIBLE but I'm too lazy to simplify this right now
if( gHUD.cl_righthand && gHUD.cl_righthand->value > 0.0f && bIsViewModel && !g_bHoldingShield || gHUD.GetGameType() == GAME_CZERO && bIsViewModel && g_bHoldingShield )
if( gHUD.cl_righthand && gHUD.cl_righthand->value > 0.0f && bIsViewModel )
{
bonematrix[1][0] = -bonematrix[1][0];
bonematrix[1][1] = -bonematrix[1][1];
Expand Down Expand Up @@ -838,20 +838,6 @@ int CStudioModelRenderer::StudioDrawModel(int flags)

m_pCurrentEntity = IEngineStudio.GetCurrentEntity();

if( g_bHoldingKnife && m_pCurrentEntity == gEngfuncs.GetViewModel() && (flags & STUDIO_RENDER) )
{
// Condition Zero knife viewmodel is left-handed by default, so we need to flip it too
const char *pchGameDir = gEngfuncs.pfnGetGameDirectory();
if( pchGameDir && stricmp( pchGameDir, "czero" ) != 0 )
{
bChangedRightHand = true;

iRightHandValue = gHUD.cl_righthand->value;

gHUD.cl_righthand->value = !gHUD.cl_righthand->value;
}
}

IEngineStudio.GetTimes(&m_nFrameCount, &m_clTime, &m_clOldTime);
IEngineStudio.GetViewInfo(m_vRenderOrigin, m_vUp, m_vRight, m_vNormal);
IEngineStudio.GetAliasScale(&m_fSoftwareXScale, &m_fSoftwareYScale);
Expand Down Expand Up @@ -905,6 +891,26 @@ int CStudioModelRenderer::StudioDrawModel(int flags)
return 1;
}

bool bShieldDetected = false;
bool bIsViewModel = gEngfuncs.GetViewModel() == m_pCurrentEntity;

if ( bIsViewModel && m_pStudioHeader )
{
if ( strstr( m_pStudioHeader->name, "shield" ) )
{
bShieldDetected = true;
}
}

if( ( g_bHoldingKnife || bShieldDetected ) && !( gHUD.GetGameType() == GAME_CZERO ) && bIsViewModel )
{
bChangedRightHand = true;

iRightHandValue = gHUD.cl_righthand->value;

gHUD.cl_righthand->value = !gHUD.cl_righthand->value;
}

if (m_pCurrentEntity->curstate.movetype == MOVETYPE_FOLLOW)
StudioMergeBones(m_pRenderModel);
else
Expand Down
Loading