|
|
@ -416,7 +416,7 @@ void CFuncPlat::PlatUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE |
|
|
|
void CFuncPlat::GoDown( void ) |
|
|
|
void CFuncPlat::GoDown( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( pev->noiseMovement ) |
|
|
|
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 ); |
|
|
|
ASSERT( m_toggle_state == TS_AT_TOP || m_toggle_state == TS_GOING_UP ); |
|
|
|
m_toggle_state = TS_GOING_DOWN; |
|
|
|
m_toggle_state = TS_GOING_DOWN; |
|
|
@ -430,10 +430,10 @@ void CFuncPlat::GoDown( void ) |
|
|
|
void CFuncPlat::HitBottom( void ) |
|
|
|
void CFuncPlat::HitBottom( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( pev->noiseMovement ) |
|
|
|
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 ) |
|
|
|
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 ); |
|
|
|
ASSERT( m_toggle_state == TS_GOING_DOWN ); |
|
|
|
m_toggle_state = TS_AT_BOTTOM; |
|
|
|
m_toggle_state = TS_AT_BOTTOM; |
|
|
@ -445,7 +445,7 @@ void CFuncPlat::HitBottom( void ) |
|
|
|
void CFuncPlat::GoUp( void ) |
|
|
|
void CFuncPlat::GoUp( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( pev->noiseMovement ) |
|
|
|
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 ); |
|
|
|
ASSERT( m_toggle_state == TS_AT_BOTTOM || m_toggle_state == TS_GOING_DOWN ); |
|
|
|
m_toggle_state = TS_GOING_UP; |
|
|
|
m_toggle_state = TS_GOING_UP; |
|
|
@ -459,10 +459,10 @@ void CFuncPlat::GoUp( void ) |
|
|
|
void CFuncPlat::HitTop( void ) |
|
|
|
void CFuncPlat::HitTop( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( pev->noiseMovement ) |
|
|
|
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 ) |
|
|
|
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 ); |
|
|
|
ASSERT( m_toggle_state == TS_GOING_UP ); |
|
|
|
m_toggle_state = TS_AT_TOP; |
|
|
|
m_toggle_state = TS_AT_TOP; |
|
|
@ -482,7 +482,7 @@ void CFuncPlat::Blocked( CBaseEntity *pOther ) |
|
|
|
pOther->TakeDamage( pev, pev, 1, DMG_CRUSH ); |
|
|
|
pOther->TakeDamage( pev, pev, 1, DMG_CRUSH ); |
|
|
|
|
|
|
|
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
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
|
|
|
|
// Send the platform back where it came from
|
|
|
|
ASSERT( m_toggle_state == TS_GOING_UP || m_toggle_state == TS_GOING_DOWN ); |
|
|
|
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 |
|
|
|
pev->nextthink = 0; |
|
|
|
pev->nextthink = 0; |
|
|
|
pev->velocity = g_vecZero; |
|
|
|
pev->velocity = g_vecZero; |
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
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 ) |
|
|
|
|
|
|
|
|
|
|
|
// clear the sound channel.
|
|
|
|
// clear the sound channel.
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
if( pev->noiseMovement ) |
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
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; |
|
|
|
pev->nextthink = 0; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -704,9 +704,9 @@ void CFuncTrain::Wait( void ) |
|
|
|
// -1 wait will wait forever!
|
|
|
|
// -1 wait will wait forever!
|
|
|
|
pev->nextthink = pev->ltime + m_flWait; |
|
|
|
pev->nextthink = pev->ltime + m_flWait; |
|
|
|
if( pev->noiseMovement ) |
|
|
|
if( pev->noiseMovement ) |
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
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 ); |
|
|
|
SetThink( &CFuncTrain::Next ); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -728,10 +728,10 @@ void CFuncTrain::Next( void ) |
|
|
|
if( !pTarg ) |
|
|
|
if( !pTarg ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( pev->noiseMovement ) |
|
|
|
if( pev->noiseMovement ) |
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noiseMovement ) ); |
|
|
|
// Play stop sound
|
|
|
|
// Play stop sound
|
|
|
|
if( pev->noiseStopMoving ) |
|
|
|
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; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -767,8 +767,8 @@ void CFuncTrain::Next( void ) |
|
|
|
// this is not a hack or temporary fix, this is how things should be. (sjb).
|
|
|
|
// this is not a hack or temporary fix, this is how things should be. (sjb).
|
|
|
|
if( pev->noiseMovement ) |
|
|
|
if( pev->noiseMovement ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noiseMovement ) ); |
|
|
|
STOP_SOUND( edict(), CHAN_STATIC, STRING( 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 ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ClearBits( pev->effects, EF_NOINTERP ); |
|
|
|
ClearBits( pev->effects, EF_NOINTERP ); |
|
|
@ -1061,7 +1061,7 @@ void CFuncTrackTrain::StopSound( void ) |
|
|
|
PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_UPDATE, edict(), m_usAdjustPitch, 0.0, |
|
|
|
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 ); |
|
|
|
(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 ); |
|
|
|
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 ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// play startup sound for train
|
|
|
|
// 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_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; |
|
|
|
m_soundPlaying = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
// update pitch
|
|
|
|
// 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
|
|
|
|
// volume 0.0 - 1.0 - 6 bits
|
|
|
|
// m_sounds 3 bits
|
|
|
|
// m_sounds 3 bits
|
|
|
|