diff --git a/dlls/visitors/pipe.cpp b/dlls/visitors/pipe.cpp index 9d00a5c2..707bc64b 100644 --- a/dlls/visitors/pipe.cpp +++ b/dlls/visitors/pipe.cpp @@ -61,13 +61,18 @@ void CPipe::Spawn() void CPipe::Precache(void) { - CCrowbar::Precache(); - - PRECACHE_MODEL("models/v_pipe.mdl"); - PRECACHE_MODEL("models/w_pipe.mdl"); - PRECACHE_MODEL("models/p_pipe.mdl"); - - m_usPipe = PRECACHE_EVENT(1, "events/pipe.sc"); + PRECACHE_MODEL( "models/v_pipe.mdl" ); + PRECACHE_MODEL( "models/w_pipe.mdl" ); + PRECACHE_MODEL( "models/p_pipe.mdl" ); + + // PRECACHE_SOUND( "weapons/cbar_hit1.wav" ); + // PRECACHE_SOUND( "weapons/cbar_hit2.wav" ); + // PRECACHE_SOUND( "weapons/cbar_hitbod1.wav" ); + // PRECACHE_SOUND( "weapons/cbar_hitbod2.wav" ); + // PRECACHE_SOUND( "weapons/cbar_hitbod3.wav" ); + // PRECACHE_SOUND( "weapons/cbar_miss1.wav" ); + + m_usPipe = PRECACHE_EVENT( 1, "events/pipe.sc" ); } int CPipe::GetItemInfo(ItemInfo *p) @@ -85,7 +90,17 @@ int CPipe::GetItemInfo(ItemInfo *p) return 1; } - +int CPipe::AddToPlayer( CBasePlayer *pPlayer ) +{ + if( CBasePlayerWeapon::AddToPlayer( pPlayer ) ) + { + MESSAGE_BEGIN( MSG_ONE, gmsgWeapPickup, NULL, pPlayer->pev ); + WRITE_BYTE( m_iId ); + MESSAGE_END(); + return TRUE; + } + return FALSE; +} BOOL CPipe::Deploy() { @@ -109,6 +124,16 @@ void CPipe::PrimaryAttack() } } +void CPipe::Smack() +{ + DecalGunshot( &m_trHit, BULLET_PLAYER_CROWBAR ); +} + +void CPipe::SwingAgain( void ) +{ + Swing( 0 ); +} + int CPipe::Swing(int fFirst) { int fDidHit = FALSE; @@ -270,7 +295,7 @@ int CPipe::Swing(int fFirst) } #ifdef CROWBAR_IDLE_ANIM -void CCrowbar::WeaponIdle( void ) +void CPipe::WeaponIdle() { if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() ) { diff --git a/dlls/weapons.h b/dlls/weapons.h index 68d48516..4fa7963e 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -1017,20 +1017,35 @@ private: unsigned short m_usSnarkFire; }; -class CPipe : public CCrowbar +class CPipe : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 1; } + void EXPORT SwingAgain( void ); + void EXPORT Smack( void ); int GetItemInfo( ItemInfo *p ); + int AddToPlayer( CBasePlayer *pPlayer ); void PrimaryAttack( void ); int Swing( int fFirst ); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); +#ifdef CROWBAR_IDLE_ANIM + void WeaponIdle(); +#endif int m_iSwing; TraceResult m_trHit; + + virtual BOOL UseDecrement( void ) + { +#if defined( CLIENT_WEAPONS ) + return TRUE; +#else + return FALSE; +#endif + } private: unsigned short m_usPipe; };