Two misc. fixes

This commit is contained in:
Blixibon 2022-07-16 00:05:28 -05:00
parent 5536021e4f
commit 0615b367ca
2 changed files with 5 additions and 1 deletions

View File

@ -1263,6 +1263,10 @@ Class_T CHL2_Player::Classify ( void )
if(IsInAVehicle()) if(IsInAVehicle())
{ {
IServerVehicle *pVehicle = GetVehicle(); IServerVehicle *pVehicle = GetVehicle();
#ifdef MAPBASE
if (!pVehicle)
return CLASS_PLAYER;
#endif
return pVehicle->ClassifyPassenger( this, CLASS_PLAYER ); return pVehicle->ClassifyPassenger( this, CLASS_PLAYER );
} }
else else

View File

@ -1003,7 +1003,7 @@ void CWeaponCrossbow::FireBolt( void )
inline void CWeaponCrossbow::SetBolt( int iSetting ) inline void CWeaponCrossbow::SetBolt( int iSetting )
{ {
int iBody = FindBodygroupByName( "bolt" ); int iBody = FindBodygroupByName( "bolt" );
if (iBody != -1 || (GetOwner() && GetOwner()->IsPlayer())) // HACKHACK: Player models check the viewmodel instead of the worldmodel, so we have to do this manually if (iBody != -1 /*|| (GetOwner() && GetOwner()->IsPlayer())*/) // TODO: Player models check the viewmodel instead of the worldmodel, but setting the bodygroup regardless can cause a crash, so we need a better solution
SetBodygroup( iBody, iSetting ); SetBodygroup( iBody, iSetting );
else else
m_nSkin = iSetting; m_nSkin = iSetting;