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() @@ -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) @@ -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() @@ -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) @@ -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() )
{

17
dlls/weapons.h

@ -1017,20 +1017,35 @@ private: @@ -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;
};

Loading…
Cancel
Save