mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-13 23:37:58 +03:00
Fixed issues with hand viewmodels not working upon weapon holster + Added a way to set the hand viewmodel bodygroup
This commit is contained in:
parent
f880e95e47
commit
35f941d6d0
@ -142,7 +142,7 @@ void respawn( CBaseEntity *pEdict, bool fCopyCorpse )
|
|||||||
{
|
{
|
||||||
// In SP respawns, only create corpse if drawing externally
|
// In SP respawns, only create corpse if drawing externally
|
||||||
CBasePlayer *pPlayer = (CBasePlayer*)pEdict;
|
CBasePlayer *pPlayer = (CBasePlayer*)pEdict;
|
||||||
if ( fCopyCorpse && pPlayer->m_bDrawPlayerModelExternally )
|
if ( fCopyCorpse && pPlayer->GetDrawPlayerModelExternally() )
|
||||||
{
|
{
|
||||||
// make a copy of the dead body for appearances sake
|
// make a copy of the dead body for appearances sake
|
||||||
pPlayer->CreateCorpse();
|
pPlayer->CreateCorpse();
|
||||||
|
@ -259,6 +259,7 @@ public:
|
|||||||
|
|
||||||
void InputSetHandModel( inputdata_t &inputdata );
|
void InputSetHandModel( inputdata_t &inputdata );
|
||||||
void InputSetHandModelSkin( inputdata_t &inputdata );
|
void InputSetHandModelSkin( inputdata_t &inputdata );
|
||||||
|
void InputSetHandModelBodyGroup( inputdata_t &inputdata );
|
||||||
|
|
||||||
void InputSetPlayerModel( inputdata_t &inputdata );
|
void InputSetPlayerModel( inputdata_t &inputdata );
|
||||||
void InputSetPlayerDrawExternally( inputdata_t &inputdata );
|
void InputSetPlayerDrawExternally( inputdata_t &inputdata );
|
||||||
@ -4617,6 +4618,7 @@ BEGIN_DATADESC( CLogicPlayerProxy )
|
|||||||
DEFINE_INPUTFUNC( FIELD_STRING, "GetAmmoOnWeapon", InputGetAmmoOnWeapon ),
|
DEFINE_INPUTFUNC( FIELD_STRING, "GetAmmoOnWeapon", InputGetAmmoOnWeapon ),
|
||||||
DEFINE_INPUTFUNC( FIELD_STRING, "SetHandModel", InputSetHandModel ),
|
DEFINE_INPUTFUNC( FIELD_STRING, "SetHandModel", InputSetHandModel ),
|
||||||
DEFINE_INPUTFUNC( FIELD_INTEGER, "SetHandModelSkin", InputSetHandModelSkin ),
|
DEFINE_INPUTFUNC( FIELD_INTEGER, "SetHandModelSkin", InputSetHandModelSkin ),
|
||||||
|
DEFINE_INPUTFUNC( FIELD_INTEGER, "SetHandModelBodyGroup", InputSetHandModelBodyGroup ),
|
||||||
DEFINE_INPUTFUNC( FIELD_STRING, "SetPlayerModel", InputSetPlayerModel ),
|
DEFINE_INPUTFUNC( FIELD_STRING, "SetPlayerModel", InputSetPlayerModel ),
|
||||||
DEFINE_INPUTFUNC( FIELD_BOOLEAN, "SetPlayerDrawExternally", InputSetPlayerDrawExternally ),
|
DEFINE_INPUTFUNC( FIELD_BOOLEAN, "SetPlayerDrawExternally", InputSetPlayerDrawExternally ),
|
||||||
DEFINE_INPUT( m_MaxArmor, FIELD_INTEGER, "SetMaxInputArmor" ),
|
DEFINE_INPUT( m_MaxArmor, FIELD_INTEGER, "SetMaxInputArmor" ),
|
||||||
@ -4659,6 +4661,8 @@ bool CLogicPlayerProxy::KeyValue( const char *szKeyName, const char *szValue )
|
|||||||
vm->SetModel(szValue);
|
vm->SetModel(szValue);
|
||||||
else if (FStrEq(szKeyName, "Skin")) // HandsVMSkin
|
else if (FStrEq(szKeyName, "Skin")) // HandsVMSkin
|
||||||
vm->m_nSkin = atoi(szValue);
|
vm->m_nSkin = atoi(szValue);
|
||||||
|
else if (FStrEq(szKeyName, "Body")) // HandsVMBody
|
||||||
|
vm->m_nBody = atoi(szValue);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -5062,6 +5066,17 @@ void CLogicPlayerProxy::InputSetHandModelSkin( inputdata_t &inputdata )
|
|||||||
vm->m_nSkin = inputdata.value.Int();
|
vm->m_nSkin = inputdata.value.Int();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLogicPlayerProxy::InputSetHandModelBodyGroup( inputdata_t &inputdata )
|
||||||
|
{
|
||||||
|
if (!m_hPlayer)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CBasePlayer *pPlayer = static_cast<CBasePlayer*>( m_hPlayer.Get() );
|
||||||
|
CBaseViewModel *vm = pPlayer->GetViewModel(1);
|
||||||
|
if (vm)
|
||||||
|
vm->m_nBody = inputdata.value.Int();
|
||||||
|
}
|
||||||
|
|
||||||
void CLogicPlayerProxy::InputSetPlayerModel( inputdata_t &inputdata )
|
void CLogicPlayerProxy::InputSetPlayerModel( inputdata_t &inputdata )
|
||||||
{
|
{
|
||||||
if (!m_hPlayer)
|
if (!m_hPlayer)
|
||||||
|
@ -289,6 +289,16 @@ void CBaseViewModel::AddEffects( int nEffects )
|
|||||||
SetControlPanelsActive( false );
|
SetControlPanelsActive( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
// Apply effect changes to any viewmodel children as well
|
||||||
|
// (fixes hand models)
|
||||||
|
for (CBaseEntity *pChild = FirstMoveChild(); pChild != NULL; pChild = pChild->NextMovePeer())
|
||||||
|
{
|
||||||
|
if (pChild->GetClassname()[0] == 'h')
|
||||||
|
pChild->AddEffects( nEffects );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
BaseClass::AddEffects( nEffects );
|
BaseClass::AddEffects( nEffects );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,6 +312,16 @@ void CBaseViewModel::RemoveEffects( int nEffects )
|
|||||||
SetControlPanelsActive( true );
|
SetControlPanelsActive( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
// Apply effect changes to any viewmodel children as well
|
||||||
|
// (fixes hand models)
|
||||||
|
for (CBaseEntity *pChild = FirstMoveChild(); pChild != NULL; pChild = pChild->NextMovePeer())
|
||||||
|
{
|
||||||
|
if (pChild->GetClassname()[0] == 'h')
|
||||||
|
pChild->RemoveEffects( nEffects );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
BaseClass::RemoveEffects( nEffects );
|
BaseClass::RemoveEffects( nEffects );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user