BOOL AvHBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal, int body) { if (!CanDeploy( )) return FALSE; m_pPlayer->TabulateAmmo(); // This was causing a crash from hl_weapons.cpp only when connected to a dedicated server and switching weapons //#ifdef AVH_SERVER //m_pPlayer->pev->viewmodel = MAKE_STRING(szViewModel); //#endif #ifdef AVH_SERVER m_pPlayer->pev->viewmodel = MAKE_STRING(szViewModel); m_pPlayer->pev->weaponmodel = MAKE_STRING(szWeaponModel); #else gEngfuncs.CL_LoadModel( szViewModel, &m_pPlayer->pev->viewmodel ); gEngfuncs.CL_LoadModel( szWeaponModel, &m_pPlayer->pev->weaponmodel ); #endif strcpy( m_pPlayer->m_szAnimExtention, szAnimExt ); //SendWeaponAnim( iAnim, skiplocal, body ); this->SendWeaponAnim(iAnim); // Set the player animation as well //this->m_pPlayer->SetAnimation(PLAYER_ANIM(iAnim)); m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + this->GetDeployTime(); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + this->GetDeployTime() + kDeployIdleInterval; return TRUE; }
/* ===================== CBasePlayerWeapon :: DefaultDeploy ===================== */ BOOL CBasePlayerWeapon :: DefaultDeploy( const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal ) { if ( !CanDeploy() ) return FALSE; gEngfuncs.CL_LoadModel( szViewModel, &m_pPlayer->pev->viewmodel ); SendWeaponAnim( iAnim ); m_pPlayer->m_flNextAttack = 0.5; m_flTimeWeaponIdle = 1.0; return TRUE; }
/* ===================== CBasePlayerWeapon :: DefaultDeploy ===================== */ BOOL CBasePlayerWeapon :: DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal, int body ) { if ( !CanDeploy() ) return FALSE; gEngfuncs.CL_LoadModel( szViewModel, &m_pPlayer->pev->viewmodel ); SendWeaponAnim( iAnim, skiplocal, body ); m_pPlayer->m_flNextAttack = this->GetDeployTime(); m_flTimeWeaponIdle = this->GetDeployTime() + kDeployIdleInterval; return TRUE; }
/* ===================== CBasePlayerWeapon :: DefaultDeploy ===================== */ bool CBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal, int body ) { if ( !CanDeploy() ) return false; gEngfuncs.CL_LoadModel( szViewModel, &m_pPlayer->pev->viewmodel ); SendWeaponAnim( iAnim, skiplocal, body ); g_brunninggausspred = false; m_pPlayer->m_flNextAttack = 0.5; m_flTimeWeaponIdle = 1.0; return true; }
BOOL CBasePlayerWeapon :: DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal /* = 0 */ ) { if (!CanDeploy( )) return FALSE; m_pPlayer->pev->viewmodel = MAKE_STRING(szViewModel); m_pPlayer->pev->weaponmodel = MAKE_STRING(szWeaponModel); strcpy( m_pPlayer->m_szAnimExtention, szAnimExt ); SendWeaponAnim( iAnim, skiplocal ); m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; return TRUE; }
BOOL CBasePlayerWeapon :: DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal /* = 0 */, int body ) { if (!CanDeploy( )) return FALSE; // Removed by Pcjoe // m_pPlayer->TabulateAmmo(); m_pPlayer->pev->viewmodel = MAKE_STRING(szViewModel); m_pPlayer->pev->weaponmodel = MAKE_STRING(szWeaponModel); strcpy( m_pPlayer->m_szAnimExtention, szAnimExt ); SendWeaponAnim( iAnim, skiplocal, body ); m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; // Added by Pcjoe, send draw animation m_pPlayer->m_Anim.AddWeaponAnimation( PLAY_DRAW ); return TRUE; }
//========================================================= // IsUseable - this function determines whether or not a // weapon is useable by the player in its current state. // (does it have ammo loaded? do I have any ammo for the // weapon?, etc) //========================================================= BOOL CBasePlayerWeapon :: IsUseable( void ) { return CanDeploy(); }