//----------------------------------------------------------------------------- // Purpose: Sets HL2 specific defaults. //----------------------------------------------------------------------------- void CHL2MP_Player::Spawn(void) { m_flNextModelChangeTime = 0.0f; m_flNextTeamChangeTime = 0.0f; PickDefaultSpawnTeam(); BaseClass::Spawn(); if ( !IsObserver() ) { pl.deadflag = false; RemoveSolidFlags( FSOLID_NOT_SOLID ); RemoveEffects( EF_NODRAW ); GiveDefaultItems(); } SetNumAnimOverlays( 3 ); ResetAnimation(); m_nRenderFX = kRenderNormal; m_Local.m_iHideHUD = 0; AddFlag(FL_ONGROUND); // set the player on the ground at the start of the round. m_impactEnergyScale = HL2MPPLAYER_PHYSDAMAGE_SCALE; if ( HL2MPRules()->IsIntermission() ) { AddFlag( FL_FROZEN ); } else { RemoveFlag( FL_FROZEN ); } m_iSpawnInterpCounter = (m_iSpawnInterpCounter + 1) % 8; m_Local.m_bDucked = false; SetPlayerUnderwater(false); m_bReady = false; m_flNextKickAttack = gpGlobals->curtime; CBaseViewModel *Leg = GetViewModel(1); Leg->SetWeaponModel("models/weapons/v_kick.mdl", NULL); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWarsWeapon::SetViewModel() { CUnitBase *pUnit; CHL2WarsPlayer *pOwner; pUnit = GetOwner()->MyUnitPointer(); if ( pUnit ) { pOwner = pUnit->GetCommander(); if( pOwner ) { CBaseViewModel *vm = pOwner->GetViewModel( m_nViewModelIndex ); if ( vm == NULL ) return; Assert( vm->ViewModelIndex() == m_nViewModelIndex ); vm->SetWeaponModel( GetViewModel( m_nViewModelIndex ), this ); } } BaseClass::SetViewModel(); }