nope, no client dll ifdefs in the file except the reload function(the
part that resets FOV)
heres my glock cpp file
//========= Copyright � 1996-2005, Valve Corporation, All rights
reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
//#include "weapon_sdkbase.h"
#include "weapon_glock.h"
#include "sdk_fx_shared.h"
#include "sdk_player.h"
IMPLEMENT_SERVERCLASS_ST(CWeaponGlock, DT_WeaponGlock)
END_SEND_TABLE()
LINK_ENTITY_TO_CLASS( weapon_glock, CWeaponGlock );
PRECACHE_WEAPON_REGISTER( weapon_glock );
BEGIN_PREDICTION_DATA( CWeaponGlock )
END_PREDICTION_DATA()
CWeaponGlock::CWeaponGlock()
{
}
bool CWeaponGlock::Deploy( )
{
CSDKPlayer *pPlayer = GetPlayerOwner();
pPlayer->m_iShotsFired = 0;
return BaseClass::Deploy();
}
bool CWeaponGlock::Reload( )
{
CSDKPlayer *pPlayer = GetPlayerOwner();
if (pPlayer->GetAmmoCount( GetPrimaryAmmoType() ) <= 0)
return false;
int iResult = DefaultReload( GetMaxClip1(), GetMaxClip2(),
ACT_VM_RELOAD );
if ( !iResult )
return false;
pPlayer->SetAnimation( PLAYER_RELOAD );
#ifndef CLIENT_DLL
if ((iResult) && (pPlayer->GetFOV() != pPlayer->GetDefaultFOV()))
{
pPlayer->SetFOV( pPlayer, pPlayer->GetDefaultFOV() );
}
#endif
pPlayer->m_iShotsFired = 0;
return true;
}
void CWeaponGlock::PrimaryAttack( void )
{
const CSDKWeaponInfo &pWeaponInfo = GetSDKWpnData();
CSDKPlayer *pPlayer = GetPlayerOwner();
float flCycleTime = pWeaponInfo.m_flCycleTime;
bool bPrimaryMode = true;
float flSpread = 0.01f;
pPlayer->m_iShotsFired++;
// Out of ammo?
if ( m_iClip1 <= 0 )
{
if (m_bFireOnEmpty)
{
PlayEmptySound();
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
}
}
SendWeaponAnim( ACT_VM_PRIMARYATTACK );
m_iClip1--;
// player "shoot" animation
pPlayer->SetAnimation( PLAYER_ATTACK1 );
FX_FireBullets(
pPlayer->entindex(),
pPlayer->Weapon_ShootPosition(),
pPlayer->EyeAngles() + pPlayer->GetPunchAngle(),
GetWeaponID(),
bPrimaryMode?Primary_Mode:Secondary_Mode,
CBaseEntity::GetPredictionRandomSeed() & 255,
flSpread );
pPlayer->DoMuzzleFlash();
m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals->curtime +
0.3;
if (!m_iClip1 && pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) <= 0)
{
// HEV suit - indicate out of ammo condition
pPlayer->SetSuitUpdate("!HEV_AMO0", false, 0);
}
// start idle animation in 5 seconds
SetWeaponIdleTime( gpGlobals->curtime + 5.0 );
}
void CWeaponGlock::SecondaryAttack( void )
{
const CSDKWeaponInfo &pWeaponInfo = GetSDKWpnData();
CSDKPlayer *pPlayer = GetPlayerOwner();
float flCycleTime = pWeaponInfo.m_flCycleTime;
bool bPrimaryMode = false;
float flSpread = 0.05f;
pPlayer->m_iShotsFired++;
// Out of ammo?
if ( m_iClip1 <= 0 )
{
if (m_bFireOnEmpty)
{
PlayEmptySound();
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
}
}
SendWeaponAnim( ACT_VM_SECONDARYATTACK );
m_iClip1--;
// player "shoot" animation
pPlayer->SetAnimation( PLAYER_ATTACK1 );
FX_FireBullets(
pPlayer->entindex(),
pPlayer->Weapon_ShootPosition(),
pPlayer->EyeAngles() + pPlayer->GetPunchAngle(),
GetWeaponID(),
bPrimaryMode?Primary_Mode:Secondary_Mode,
CBaseEntity::GetPredictionRandomSeed() & 255,
flSpread );
pPlayer->DoMuzzleFlash();
m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals->curtime +
0.2;
if (!m_iClip1 && pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) <= 0)
{
// HEV suit - indicate out of ammo condition
pPlayer->SetSuitUpdate("!HEV_AMO0", false, 0);
}
// start idle animation in 5 seconds
SetWeaponIdleTime( gpGlobals->curtime + 5.0 );
}
void CWeaponGlock::WeaponIdle()
{
if (m_flTimeWeaponIdle > gpGlobals->curtime)
return;
// only idle if the slid isn't back
if ( m_iClip1 != 0 )
{
SetWeaponIdleTime( gpGlobals->curtime + 5.0f );
SendWeaponAnim( ACT_VM_IDLE );
}
}
anyone see the problem?
--
**********************
Draco
Coder for Perfect Dark and Kreedz Climbing
http://perfectdark.game-mod.net
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders