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
13 changes: 8 additions & 5 deletions sp/src/game/shared/baseviewmodel_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,16 @@ void CBaseViewModel::SetWeaponModel( const char *modelname, CBaseCombatWeapon *w
#endif

#ifdef MAPBASE
// If our owning weapon doesn't support hands, disable the hands viewmodel(s)
bool bSupportsHands = weapon != NULL ? weapon->UsesHands() : false;
for (CBaseEntity *pChild = FirstMoveChild(); pChild != NULL; pChild = pChild->NextMovePeer())
if ( !( GetEffects() & EF_NODRAW ) )
{
if (pChild->GetClassname()[0] == 'h')
// If our owning weapon doesn't support hands, disable the hands viewmodel(s)
bool bSupportsHands = weapon != NULL ? weapon->UsesHands() : false;
for (CBaseEntity *pChild = FirstMoveChild(); pChild != NULL; pChild = pChild->NextMovePeer())
{
bSupportsHands ? pChild->RemoveEffects( EF_NODRAW ) : pChild->AddEffects( EF_NODRAW );
if (pChild->GetClassname()[0] == 'h')
{
bSupportsHands ? pChild->RemoveEffects( EF_NODRAW ) : pChild->AddEffects( EF_NODRAW );
}
}
}
#endif
Expand Down