|
|
|
@ -416,7 +416,7 @@ void CFuncPlat::PlatUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
@@ -416,7 +416,7 @@ void CFuncPlat::PlatUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
|
|
|
|
|
void CFuncPlat::GoDown( void ) |
|
|
|
|
{ |
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMovement ), m_volume, ATTN_NORM ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMovement ), m_volume, ATTN_NORM ); |
|
|
|
|
|
|
|
|
|
ASSERT( m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP ); |
|
|
|
|
m_toggle_state = TS_GOING_DOWN; |
|
|
|
@ -430,10 +430,10 @@ void CFuncPlat::GoDown( void )
@@ -430,10 +430,10 @@ void CFuncPlat::GoDown( void )
|
|
|
|
|
void CFuncPlat::HitBottom( void ) |
|
|
|
|
{ |
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
|
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
|
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
|
|
|
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, (char*)STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
|
|
|
|
|
ASSERT( m_toggle_state == TS_GOING_DOWN ); |
|
|
|
|
m_toggle_state = TS_AT_BOTTOM; |
|
|
|
@ -445,7 +445,7 @@ void CFuncPlat::HitBottom( void )
@@ -445,7 +445,7 @@ void CFuncPlat::HitBottom( void )
|
|
|
|
|
void CFuncPlat::GoUp( void ) |
|
|
|
|
{ |
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMovement ), m_volume, ATTN_NORM ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMovement ), m_volume, ATTN_NORM ); |
|
|
|
|
|
|
|
|
|
ASSERT( m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN ); |
|
|
|
|
m_toggle_state = TS_GOING_UP; |
|
|
|
@ -459,10 +459,10 @@ void CFuncPlat::GoUp( void )
@@ -459,10 +459,10 @@ void CFuncPlat::GoUp( void )
|
|
|
|
|
void CFuncPlat::HitTop( void ) |
|
|
|
|
{ |
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
|
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
|
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
|
|
|
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, (char*)STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
|
|
|
|
|
ASSERT( m_toggle_state == TS_GOING_UP ); |
|
|
|
|
m_toggle_state = TS_AT_TOP; |
|
|
|
@ -482,7 +482,7 @@ void CFuncPlat::Blocked( CBaseEntity *pOther )
@@ -482,7 +482,7 @@ void CFuncPlat::Blocked( CBaseEntity *pOther )
|
|
|
|
|
pOther->TakeDamage( pev, pev, 1, DMG_CRUSH ); |
|
|
|
|
|
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
|
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
|
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
|
|
|
|
|
|
// Send the platform back where it came from
|
|
|
|
|
ASSERT( m_toggle_state == TS_GOING_UP || m_toggle_state == TS_GOING_DOWN ); |
|
|
|
@ -670,7 +670,7 @@ void CFuncTrain::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us
@@ -670,7 +670,7 @@ void CFuncTrain::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us
|
|
|
|
|
pev->nextthink = 0; |
|
|
|
|
pev->velocity = g_vecZero; |
|
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -691,9 +691,9 @@ void CFuncTrain::Wait( void )
@@ -691,9 +691,9 @@ void CFuncTrain::Wait( void )
|
|
|
|
|
|
|
|
|
|
// clear the sound channel.
|
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
pev->nextthink = 0; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -704,9 +704,9 @@ void CFuncTrain::Wait( void )
@@ -704,9 +704,9 @@ void CFuncTrain::Wait( void )
|
|
|
|
|
// -1 wait will wait forever!
|
|
|
|
|
pev->nextthink = pev->ltime + m_flWait; |
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
SetThink( &CFuncTrain::Next ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
@ -728,10 +728,10 @@ void CFuncTrain::Next( void )
@@ -728,10 +728,10 @@ void CFuncTrain::Next( void )
|
|
|
|
|
if( !pTarg ) |
|
|
|
|
{ |
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
|
// Play stop sound
|
|
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noiseStopMoving ), m_volume, ATTN_NORM ); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -767,8 +767,8 @@ void CFuncTrain::Next( void )
@@ -767,8 +767,8 @@ void CFuncTrain::Next( void )
|
|
|
|
|
// this is not a hack or temporary fix, this is how things should be. (sjb).
|
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
|
{ |
|
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMovement ), m_volume, ATTN_NORM ); |
|
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
|
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMovement ), m_volume, ATTN_NORM ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ClearBits( pev->effects, EF_NOINTERP ); |
|
|
|
@ -1061,7 +1061,7 @@ void CFuncTrackTrain::StopSound( void )
@@ -1061,7 +1061,7 @@ void CFuncTrackTrain::StopSound( void )
|
|
|
|
|
PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_UPDATE, edict(), m_usAdjustPitch, 0.0, |
|
|
|
|
(float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, us_encode, 0, 1, 0 ); |
|
|
|
|
/*
|
|
|
|
|
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noise ) ); |
|
|
|
|
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noise ) ); |
|
|
|
|
*/ |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_ITEM, "plats/ttrain_brake1.wav", m_flVolume, ATTN_NORM, 0, 100 ); |
|
|
|
|
} |
|
|
|
@ -1085,14 +1085,14 @@ void CFuncTrackTrain::UpdateSound( void )
@@ -1085,14 +1085,14 @@ void CFuncTrackTrain::UpdateSound( void )
|
|
|
|
|
{ |
|
|
|
|
// play startup sound for train
|
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_ITEM, "plats/ttrain_start1.wav", m_flVolume, ATTN_NORM, 0, 100 ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noise ), m_flVolume, ATTN_NORM, 0, (int)flpitch ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, STRING( pev->noise ), m_flVolume, ATTN_NORM, 0, (int)flpitch ); |
|
|
|
|
m_soundPlaying = 1; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
/*
|
|
|
|
|
// update pitch
|
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noise ), m_flVolume, ATTN_NORM, SND_CHANGE_PITCH, (int)flpitch ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, STRING( pev->noise ), m_flVolume, ATTN_NORM, SND_CHANGE_PITCH, (int)flpitch ); |
|
|
|
|
*/ |
|
|
|
|
// volume 0.0 - 1.0 - 6 bits
|
|
|
|
|
// m_sounds 3 bits
|
|
|
|
@ -1322,7 +1322,7 @@ BOOL CFuncTrackTrain::OnControls( entvars_t *pevTest )
@@ -1322,7 +1322,7 @@ BOOL CFuncTrackTrain::OnControls( entvars_t *pevTest )
|
|
|
|
|
|
|
|
|
|
void CFuncTrackTrain::Find( void ) |
|
|
|
|
{ |
|
|
|
|
m_ppath = CPathTrack::Instance(FIND_ENTITY_BY_TARGETNAME( NULL, STRING( pev->target ) ) ); |
|
|
|
|
m_ppath = CPathTrack::Instance( FIND_ENTITY_BY_TARGETNAME( NULL, STRING( pev->target ) ) ); |
|
|
|
|
if( !m_ppath ) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|