Browse Source

Fix build.

visitors
Night Owl 7 years ago
parent
commit
65ef3a70fe
  1. 43
      dlls/visitors/pipe.cpp
  2. 17
      dlls/weapons.h

43
dlls/visitors/pipe.cpp

@ -61,13 +61,18 @@ void CPipe::Spawn()
void CPipe::Precache(void) void CPipe::Precache(void)
{ {
CCrowbar::Precache(); PRECACHE_MODEL( "models/v_pipe.mdl" );
PRECACHE_MODEL( "models/w_pipe.mdl" );
PRECACHE_MODEL("models/v_pipe.mdl"); PRECACHE_MODEL( "models/p_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" );
m_usPipe = PRECACHE_EVENT(1, "events/pipe.sc"); // 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) int CPipe::GetItemInfo(ItemInfo *p)
@ -85,7 +90,17 @@ int CPipe::GetItemInfo(ItemInfo *p)
return 1; 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() 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 CPipe::Swing(int fFirst)
{ {
int fDidHit = FALSE; int fDidHit = FALSE;
@ -270,7 +295,7 @@ int CPipe::Swing(int fFirst)
} }
#ifdef CROWBAR_IDLE_ANIM #ifdef CROWBAR_IDLE_ANIM
void CCrowbar::WeaponIdle( void ) void CPipe::WeaponIdle()
{ {
if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() ) if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() )
{ {

17
dlls/weapons.h

@ -1017,20 +1017,35 @@ private:
unsigned short m_usSnarkFire; unsigned short m_usSnarkFire;
}; };
class CPipe : public CCrowbar class CPipe : public CBasePlayerWeapon
{ {
public: public:
void Spawn( void ); void Spawn( void );
void Precache( void ); void Precache( void );
int iItemSlot( void ) { return 1; } int iItemSlot( void ) { return 1; }
void EXPORT SwingAgain( void );
void EXPORT Smack( void );
int GetItemInfo( ItemInfo *p ); int GetItemInfo( ItemInfo *p );
int AddToPlayer( CBasePlayer *pPlayer );
void PrimaryAttack( void ); void PrimaryAttack( void );
int Swing( int fFirst ); int Swing( int fFirst );
BOOL Deploy( void ); BOOL Deploy( void );
void Holster( int skiplocal = 0 ); void Holster( int skiplocal = 0 );
#ifdef CROWBAR_IDLE_ANIM
void WeaponIdle();
#endif
int m_iSwing; int m_iSwing;
TraceResult m_trHit; TraceResult m_trHit;
virtual BOOL UseDecrement( void )
{
#if defined( CLIENT_WEAPONS )
return TRUE;
#else
return FALSE;
#endif
}
private: private:
unsigned short m_usPipe; unsigned short m_usPipe;
}; };

Loading…
Cancel
Save