mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-05 10:10:42 +03:00
Fix hand viewmodel issues on death/respawn
This commit is contained in:
parent
5cc53c10ee
commit
a7c90b042d
@ -645,8 +645,14 @@ void CBasePlayer::CreateHandModel(int index, int iOtherVm)
|
||||
{
|
||||
Assert(index >= 0 && index < MAX_VIEWMODELS && iOtherVm >= 0 && iOtherVm < MAX_VIEWMODELS );
|
||||
|
||||
if (GetViewModel(index))
|
||||
if (GetViewModel( index ))
|
||||
{
|
||||
// This can happen if the player respawns
|
||||
// Don't draw unless we're already using a hands weapon
|
||||
if ( !GetActiveWeapon() || !GetActiveWeapon()->UsesHands() )
|
||||
GetViewModel( index )->AddEffects( EF_NODRAW );
|
||||
return;
|
||||
}
|
||||
|
||||
CBaseViewModel *vm = (CBaseViewModel *)CreateEntityByName("hand_viewmodel");
|
||||
if (vm)
|
||||
@ -1719,6 +1725,15 @@ void CBasePlayer::RemoveAllItems( bool removeSuit )
|
||||
RemoveAllWeapons();
|
||||
RemoveAllAmmo();
|
||||
|
||||
#ifdef MAPBASE
|
||||
// Hide hand viewmodel
|
||||
CBaseViewModel *vm = GetViewModel( 1 );
|
||||
if ( vm )
|
||||
{
|
||||
vm->AddEffects( EF_NODRAW );
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( removeSuit )
|
||||
{
|
||||
RemoveSuit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user