mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-10 13:58:52 +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 );
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CBaseViewModel *vm = (CBaseViewModel *)CreateEntityByName("hand_viewmodel");
|
CBaseViewModel *vm = (CBaseViewModel *)CreateEntityByName("hand_viewmodel");
|
||||||
if (vm)
|
if (vm)
|
||||||
@ -1719,6 +1725,15 @@ void CBasePlayer::RemoveAllItems( bool removeSuit )
|
|||||||
RemoveAllWeapons();
|
RemoveAllWeapons();
|
||||||
RemoveAllAmmo();
|
RemoveAllAmmo();
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
// Hide hand viewmodel
|
||||||
|
CBaseViewModel *vm = GetViewModel( 1 );
|
||||||
|
if ( vm )
|
||||||
|
{
|
||||||
|
vm->AddEffects( EF_NODRAW );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( removeSuit )
|
if ( removeSuit )
|
||||||
{
|
{
|
||||||
RemoveSuit();
|
RemoveSuit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user