mirror of https://github.com/FWGS/hlsdk-xash3d
Use MAKE_STRING for literals. Remove duplicated code.
This commit is contained in:
parent
a2e4a7ec03
commit
d062757f52
|
@ -430,15 +430,13 @@ void CFuncRotating::Spawn()
|
|||
|
||||
void CFuncRotating::Precache( void )
|
||||
{
|
||||
char* szSoundFile = (char*)STRING( pev->message );
|
||||
const char* szSoundFile = STRING( pev->message );
|
||||
BOOL NullSound = FALSE;
|
||||
|
||||
// set up fan sounds
|
||||
if( !FStringNull( pev->message ) && strlen( szSoundFile ) > 0 )
|
||||
{
|
||||
// if a path is set for a wave, use it
|
||||
PRECACHE_SOUND( szSoundFile );
|
||||
|
||||
pev->noiseRunning = ALLOC_STRING( szSoundFile );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -446,41 +444,31 @@ void CFuncRotating::Precache( void )
|
|||
switch( m_sounds )
|
||||
{
|
||||
case 1:
|
||||
PRECACHE_SOUND( "fans/fan1.wav" );
|
||||
pev->noiseRunning = ALLOC_STRING( "fans/fan1.wav" );
|
||||
szSoundFile = "fans/fan1.wav";
|
||||
break;
|
||||
case 2:
|
||||
PRECACHE_SOUND( "fans/fan2.wav" );
|
||||
pev->noiseRunning = ALLOC_STRING( "fans/fan2.wav" );
|
||||
szSoundFile = "fans/fan2.wav";
|
||||
break;
|
||||
case 3:
|
||||
PRECACHE_SOUND( "fans/fan3.wav" );
|
||||
pev->noiseRunning = ALLOC_STRING( "fans/fan3.wav" );
|
||||
szSoundFile = "fans/fan3.wav";
|
||||
break;
|
||||
case 4:
|
||||
PRECACHE_SOUND( "fans/fan4.wav" );
|
||||
pev->noiseRunning = ALLOC_STRING( "fans/fan4.wav" );
|
||||
szSoundFile = "fans/fan4.wav";
|
||||
break;
|
||||
case 5:
|
||||
PRECACHE_SOUND( "fans/fan5.wav" );
|
||||
pev->noiseRunning = ALLOC_STRING( "fans/fan5.wav" );
|
||||
szSoundFile = "fans/fan5.wav";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
if( !FStringNull( pev->message ) && strlen( szSoundFile ) > 0 )
|
||||
{
|
||||
PRECACHE_SOUND( szSoundFile );
|
||||
szSoundFile = "common/null.wav";
|
||||
NullSound = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pev->noiseRunning = ALLOC_STRING( szSoundFile );
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
pev->noiseRunning = ALLOC_STRING( "common/null.wav" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( !NullSound )
|
||||
PRECACHE_SOUND( szSoundFile );
|
||||
pev->noiseRunning = MAKE_STRING( szSoundFile );
|
||||
|
||||
if( pev->avelocity != g_vecZero )
|
||||
{
|
||||
|
|
|
@ -292,14 +292,14 @@ void CBaseButton::Precache( void )
|
|||
{
|
||||
pszSound = ButtonSound( (int)m_bLockedSound );
|
||||
PRECACHE_SOUND( pszSound );
|
||||
m_ls.sLockedSound = ALLOC_STRING( pszSound );
|
||||
m_ls.sLockedSound = MAKE_STRING( pszSound );
|
||||
}
|
||||
|
||||
if( m_bUnlockedSound )
|
||||
{
|
||||
pszSound = ButtonSound( (int)m_bUnlockedSound );
|
||||
PRECACHE_SOUND( pszSound );
|
||||
m_ls.sUnlockedSound = ALLOC_STRING( pszSound );
|
||||
m_ls.sUnlockedSound = MAKE_STRING( pszSound );
|
||||
}
|
||||
|
||||
// get sentence group names, for doors which are directly 'touched' to open
|
||||
|
@ -469,7 +469,7 @@ void CBaseButton::Spawn()
|
|||
//----------------------------------------------------
|
||||
pszSound = ButtonSound( m_sounds );
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noise = ALLOC_STRING( pszSound );
|
||||
pev->noise = MAKE_STRING( pszSound );
|
||||
|
||||
Precache();
|
||||
|
||||
|
@ -876,7 +876,7 @@ void CRotButton::Spawn( void )
|
|||
//----------------------------------------------------
|
||||
pszSound = ButtonSound( m_sounds );
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noise = ALLOC_STRING( pszSound );
|
||||
pev->noise = MAKE_STRING( pszSound );
|
||||
|
||||
// set the axis of rotation
|
||||
CBaseToggle::AxisDir( pev );
|
||||
|
@ -1012,7 +1012,7 @@ void CMomentaryRotButton::Spawn( void )
|
|||
|
||||
const char *pszSound = ButtonSound( m_sounds );
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noise = ALLOC_STRING( pszSound );
|
||||
pev->noise = MAKE_STRING( pszSound );
|
||||
m_lastUsed = 0;
|
||||
}
|
||||
|
||||
|
|
190
dlls/doors.cpp
190
dlls/doors.cpp
|
@ -330,114 +330,104 @@ void CBaseDoor::SetToggleState( int state )
|
|||
void CBaseDoor::Precache( void )
|
||||
{
|
||||
const char *pszSound;
|
||||
BOOL NullSound = FALSE;
|
||||
|
||||
// set the door's "in-motion" sound
|
||||
switch( m_bMoveSnd )
|
||||
{
|
||||
case 0:
|
||||
pev->noiseMoving = ALLOC_STRING( "common/null.wav" );
|
||||
break;
|
||||
case 1:
|
||||
PRECACHE_SOUND( "doors/doormove1.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove1.wav" );
|
||||
pszSound = "doors/doormove1.wav";
|
||||
break;
|
||||
case 2:
|
||||
PRECACHE_SOUND( "doors/doormove2.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove2.wav" );
|
||||
pszSound = "doors/doormove2.wav";
|
||||
break;
|
||||
case 3:
|
||||
PRECACHE_SOUND( "doors/doormove3.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove3.wav" );
|
||||
pszSound = "doors/doormove3.wav";
|
||||
break;
|
||||
case 4:
|
||||
PRECACHE_SOUND( "doors/doormove4.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove4.wav" );
|
||||
pszSound = "doors/doormove4.wav";
|
||||
break;
|
||||
case 5:
|
||||
PRECACHE_SOUND( "doors/doormove5.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove5.wav" );
|
||||
pszSound = "doors/doormove5.wav";
|
||||
break;
|
||||
case 6:
|
||||
PRECACHE_SOUND( "doors/doormove6.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove6.wav" );
|
||||
pszSound = "doors/doormove6.wav";
|
||||
break;
|
||||
case 7:
|
||||
PRECACHE_SOUND( "doors/doormove7.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove7.wav" );
|
||||
pszSound = "doors/doormove7.wav";
|
||||
break;
|
||||
case 8:
|
||||
PRECACHE_SOUND( "doors/doormove8.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove8.wav" );
|
||||
pszSound = "doors/doormove8.wav";
|
||||
break;
|
||||
case 9:
|
||||
PRECACHE_SOUND( "doors/doormove9.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove9.wav" );
|
||||
pszSound = "doors/doormove9.wav";
|
||||
break;
|
||||
case 10:
|
||||
PRECACHE_SOUND( "doors/doormove10.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove10.wav" );
|
||||
pszSound = "doors/doormove10.wav";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
pev->noiseMoving = ALLOC_STRING( "common/null.wav" );
|
||||
pszSound = "common/null.wav";
|
||||
NullSound = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if( !NullSound )
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noiseMoving = MAKE_STRING( pszSound );
|
||||
NullSound = FALSE;
|
||||
|
||||
// set the door's 'reached destination' stop sound
|
||||
switch( m_bStopSnd )
|
||||
{
|
||||
case 0:
|
||||
pev->noiseArrived = ALLOC_STRING( "common/null.wav" );
|
||||
break;
|
||||
case 1:
|
||||
PRECACHE_SOUND( "doors/doorstop1.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop1.wav" );
|
||||
pszSound = "doors/doorstop1.wav";
|
||||
break;
|
||||
case 2:
|
||||
PRECACHE_SOUND( "doors/doorstop2.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop2.wav" );
|
||||
pszSound = "doors/doorstop2.wav";
|
||||
break;
|
||||
case 3:
|
||||
PRECACHE_SOUND( "doors/doorstop3.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop3.wav" );
|
||||
pszSound = "doors/doorstop3.wav";
|
||||
break;
|
||||
case 4:
|
||||
PRECACHE_SOUND( "doors/doorstop4.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop4.wav" );
|
||||
pszSound = "doors/doorstop4.wav";
|
||||
break;
|
||||
case 5:
|
||||
PRECACHE_SOUND( "doors/doorstop5.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop5.wav" );
|
||||
pszSound = "doors/doorstop5.wav";
|
||||
break;
|
||||
case 6:
|
||||
PRECACHE_SOUND( "doors/doorstop6.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop6.wav");
|
||||
pszSound = "doors/doorstop6.wav"
|
||||
break;
|
||||
case 7:
|
||||
PRECACHE_SOUND( "doors/doorstop7.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop7.wav" );
|
||||
pszSound = "doors/doorstop7.wav";
|
||||
break;
|
||||
case 8:
|
||||
PRECACHE_SOUND( "doors/doorstop8.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop8.wav" );
|
||||
pszSound = "doors/doorstop8.wav";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
pev->noiseArrived = ALLOC_STRING( "common/null.wav" );
|
||||
pszSound = "common/null.wav";
|
||||
NullSound = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if( !NullSound )
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noiseArrived = MAKE_STRING( pszSound );
|
||||
|
||||
// get door button sounds, for doors which are directly 'touched' to open
|
||||
if( m_bLockedSound )
|
||||
{
|
||||
pszSound = ButtonSound( (int)m_bLockedSound );
|
||||
PRECACHE_SOUND( pszSound );
|
||||
m_ls.sLockedSound = ALLOC_STRING( pszSound );
|
||||
m_ls.sLockedSound = MAKE_STRING( pszSound );
|
||||
}
|
||||
|
||||
if( m_bUnlockedSound )
|
||||
{
|
||||
pszSound = ButtonSound( (int)m_bUnlockedSound );
|
||||
PRECACHE_SOUND( pszSound );
|
||||
m_ls.sUnlockedSound = ALLOC_STRING( pszSound );
|
||||
m_ls.sUnlockedSound = MAKE_STRING( pszSound );
|
||||
}
|
||||
|
||||
// get sentence group names, for doors which are directly 'touched' to open
|
||||
|
@ -445,39 +435,39 @@ void CBaseDoor::Precache( void )
|
|||
{
|
||||
case 1:
|
||||
// access denied
|
||||
m_ls.sLockedSentence = ALLOC_STRING( "NA" );
|
||||
m_ls.sLockedSentence = MAKE_STRING( "NA" );
|
||||
break;
|
||||
case 2:
|
||||
// security lockout
|
||||
m_ls.sLockedSentence = ALLOC_STRING( "ND" );
|
||||
m_ls.sLockedSentence = MAKE_STRING( "ND" );
|
||||
break;
|
||||
case 3:
|
||||
// blast door
|
||||
m_ls.sLockedSentence = ALLOC_STRING( "NF" );
|
||||
m_ls.sLockedSentence = MAKE_STRING( "NF" );
|
||||
break;
|
||||
case 4:
|
||||
// fire door
|
||||
m_ls.sLockedSentence = ALLOC_STRING( "NFIRE" );
|
||||
m_ls.sLockedSentence = MAKE_STRING( "NFIRE" );
|
||||
break;
|
||||
case 5:
|
||||
// chemical door
|
||||
m_ls.sLockedSentence = ALLOC_STRING( "NCHEM" );
|
||||
m_ls.sLockedSentence = MAKE_STRING( "NCHEM" );
|
||||
break;
|
||||
case 6:
|
||||
// radiation door
|
||||
m_ls.sLockedSentence = ALLOC_STRING( "NRAD" );
|
||||
m_ls.sLockedSentence = MAKE_STRING( "NRAD" );
|
||||
break;
|
||||
case 7:
|
||||
// gen containment
|
||||
m_ls.sLockedSentence = ALLOC_STRING( "NCON" );
|
||||
m_ls.sLockedSentence = MAKE_STRING( "NCON" );
|
||||
break;
|
||||
case 8:
|
||||
// maintenance door
|
||||
m_ls.sLockedSentence = ALLOC_STRING( "NH" );
|
||||
m_ls.sLockedSentence = MAKE_STRING( "NH" );
|
||||
break;
|
||||
case 9:
|
||||
// broken door
|
||||
m_ls.sLockedSentence = ALLOC_STRING( "NG" );
|
||||
m_ls.sLockedSentence = MAKE_STRING( "NG" );
|
||||
break;
|
||||
default:
|
||||
m_ls.sLockedSentence = 0;
|
||||
|
@ -488,35 +478,35 @@ void CBaseDoor::Precache( void )
|
|||
{
|
||||
case 1:
|
||||
// access granted
|
||||
m_ls.sUnlockedSentence = ALLOC_STRING( "EA" );
|
||||
m_ls.sUnlockedSentence = MAKE_STRING( "EA" );
|
||||
break;
|
||||
case 2:
|
||||
// security door
|
||||
m_ls.sUnlockedSentence = ALLOC_STRING( "ED" );
|
||||
m_ls.sUnlockedSentence = MAKE_STRING( "ED" );
|
||||
break;
|
||||
case 3:
|
||||
// blast door
|
||||
m_ls.sUnlockedSentence = ALLOC_STRING( "EF" );
|
||||
m_ls.sUnlockedSentence = MAKE_STRING( "EF" );
|
||||
break;
|
||||
case 4:
|
||||
// fire door
|
||||
m_ls.sUnlockedSentence = ALLOC_STRING( "EFIRE" );
|
||||
m_ls.sUnlockedSentence = MAKE_STRING( "EFIRE" );
|
||||
break;
|
||||
case 5:
|
||||
// chemical door
|
||||
m_ls.sUnlockedSentence = ALLOC_STRING( "ECHEM" );
|
||||
m_ls.sUnlockedSentence = MAKE_STRING( "ECHEM" );
|
||||
break;
|
||||
case 6:
|
||||
// radiation door
|
||||
m_ls.sUnlockedSentence = ALLOC_STRING( "ERAD" );
|
||||
m_ls.sUnlockedSentence = MAKE_STRING( "ERAD" );
|
||||
break;
|
||||
case 7:
|
||||
// gen containment
|
||||
m_ls.sUnlockedSentence = ALLOC_STRING( "ECON" );
|
||||
m_ls.sUnlockedSentence = MAKE_STRING( "ECON" );
|
||||
break;
|
||||
case 8:
|
||||
// maintenance door
|
||||
m_ls.sUnlockedSentence = ALLOC_STRING( "EH" );
|
||||
m_ls.sUnlockedSentence = MAKE_STRING( "EH" );
|
||||
break;
|
||||
default:
|
||||
m_ls.sUnlockedSentence = 0;
|
||||
|
@ -988,91 +978,85 @@ void CMomentaryDoor::Spawn( void )
|
|||
|
||||
void CMomentaryDoor::Precache( void )
|
||||
{
|
||||
const char *pszSound;
|
||||
BOOL NullSound = FALSE;
|
||||
|
||||
// set the door's "in-motion" sound
|
||||
switch( m_bMoveSnd )
|
||||
{
|
||||
case 0:
|
||||
pev->noiseMoving = ALLOC_STRING( "common/null.wav" );
|
||||
break;
|
||||
case 1:
|
||||
PRECACHE_SOUND( "doors/doormove1.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove1.wav" );
|
||||
pszSound = "doors/doormove1.wav";
|
||||
break;
|
||||
case 2:
|
||||
PRECACHE_SOUND( "doors/doormove2.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove2.wav" );
|
||||
pszSound = "doors/doormove2.wav";
|
||||
break;
|
||||
case 3:
|
||||
PRECACHE_SOUND( "doors/doormove3.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove3.wav" );
|
||||
pszSound = "doors/doormove3.wav";
|
||||
break;
|
||||
case 4:
|
||||
PRECACHE_SOUND( "doors/doormove4.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove4.wav" );
|
||||
pszSound = "doors/doormove4.wav";
|
||||
break;
|
||||
case 5:
|
||||
PRECACHE_SOUND( "doors/doormove5.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove5.wav" );
|
||||
pszSound = "doors/doormove5.wav";
|
||||
break;
|
||||
case 6:
|
||||
PRECACHE_SOUND( "doors/doormove6.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove6.wav" );
|
||||
pszSound = "doors/doormove6.wav";
|
||||
break;
|
||||
case 7:
|
||||
PRECACHE_SOUND( "doors/doormove7.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove7.wav" );
|
||||
pszSound = "doors/doormove7.wav";
|
||||
break;
|
||||
case 8:
|
||||
PRECACHE_SOUND( "doors/doormove8.wav" );
|
||||
pev->noiseMoving = ALLOC_STRING( "doors/doormove8.wav" );
|
||||
pszSound = "doors/doormove8.wav";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
pev->noiseMoving = ALLOC_STRING( "common/null.wav" );
|
||||
pszSound = "common/null.wav";
|
||||
NullSound = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if( !NullSound )
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noiseMoving = MAKE_STRING( pszSound );
|
||||
NullSound = FALSE;
|
||||
|
||||
// set the door's 'reached destination' stop sound
|
||||
switch( m_bStopSnd )
|
||||
{
|
||||
case 0:
|
||||
pev->noiseArrived = ALLOC_STRING( "common/null.wav" );
|
||||
break;
|
||||
case 1:
|
||||
PRECACHE_SOUND( "doors/doorstop1.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop1.wav" );
|
||||
pszSound = "doors/doorstop1.wav";
|
||||
break;
|
||||
case 2:
|
||||
PRECACHE_SOUND( "doors/doorstop2.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop2.wav" );
|
||||
pszSound = "doors/doorstop2.wav";
|
||||
break;
|
||||
case 3:
|
||||
PRECACHE_SOUND( "doors/doorstop3.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING("doors/doorstop3.wav");
|
||||
pszSound = "doors/doorstop3.wav";
|
||||
break;
|
||||
case 4:
|
||||
PRECACHE_SOUND( "doors/doorstop4.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop4.wav" );
|
||||
pszSound = "doors/doorstop4.wav";
|
||||
break;
|
||||
case 5:
|
||||
PRECACHE_SOUND( "doors/doorstop5.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop5.wav" );
|
||||
pszSound = "doors/doorstop5.wav";
|
||||
break;
|
||||
case 6:
|
||||
PRECACHE_SOUND( "doors/doorstop6.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop6.wav" );
|
||||
pszSound = "doors/doorstop6.wav";
|
||||
break;
|
||||
case 7:
|
||||
PRECACHE_SOUND( "doors/doorstop7.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop7.wav" );
|
||||
pszSound = "doors/doorstop7.wav";
|
||||
break;
|
||||
case 8:
|
||||
PRECACHE_SOUND( "doors/doorstop8.wav" );
|
||||
pev->noiseArrived = ALLOC_STRING( "doors/doorstop8.wav" );
|
||||
pszSound = "doors/doorstop8.wav";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
pev->noiseArrived = ALLOC_STRING( "common/null.wav" );
|
||||
pszSound = "common/null.wav";
|
||||
NullSound = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if( !NullSound )
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noiseArrived = MAKE_STRING( pszSound );
|
||||
}
|
||||
|
||||
void CMomentaryDoor::KeyValue( KeyValueData *pkvd )
|
||||
|
|
119
dlls/plats.cpp
119
dlls/plats.cpp
|
@ -104,111 +104,100 @@ void CBasePlatTrain::KeyValue( KeyValueData *pkvd )
|
|||
|
||||
void CBasePlatTrain::Precache( void )
|
||||
{
|
||||
const char *pszSound;
|
||||
BOOL NullSound = FALSE;
|
||||
|
||||
// set the plat's "in-motion" sound
|
||||
switch( m_bMoveSnd )
|
||||
{
|
||||
case 0:
|
||||
pev->noiseMoving = MAKE_STRING( "common/null.wav" );
|
||||
break;
|
||||
case 1:
|
||||
PRECACHE_SOUND( "plats/bigmove1.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/bigmove1.wav" );
|
||||
pszSound = "plats/bigmove1.wav";
|
||||
break;
|
||||
case 2:
|
||||
PRECACHE_SOUND( "plats/bigmove2.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/bigmove2.wav" );
|
||||
pszSound = "plats/bigmove2.wav";
|
||||
break;
|
||||
case 3:
|
||||
PRECACHE_SOUND( "plats/elevmove1.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/elevmove1.wav" );
|
||||
pszSound = "plats/elevmove1.wav";
|
||||
break;
|
||||
case 4:
|
||||
PRECACHE_SOUND( "plats/elevmove2.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/elevmove2.wav" );
|
||||
pszSound = "plats/elevmove2.wav";
|
||||
break;
|
||||
case 5:
|
||||
PRECACHE_SOUND( "plats/elevmove3.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/elevmove3.wav" );
|
||||
pszSound = "plats/elevmove3.wav";
|
||||
break;
|
||||
case 6:
|
||||
PRECACHE_SOUND( "plats/freightmove1.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/freightmove1.wav" );
|
||||
pszSound = "plats/freightmove1.wav";
|
||||
break;
|
||||
case 7:
|
||||
PRECACHE_SOUND( "plats/freightmove2.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/freightmove2.wav" );
|
||||
pszSound = "plats/freightmove2.wav";
|
||||
break;
|
||||
case 8:
|
||||
PRECACHE_SOUND( "plats/heavymove1.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/heavymove1.wav" );
|
||||
pszSound = "plats/heavymove1.wav";
|
||||
break;
|
||||
case 9:
|
||||
PRECACHE_SOUND( "plats/rackmove1.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/rackmove1.wav" );
|
||||
pszSound = "plats/rackmove1.wav";
|
||||
break;
|
||||
case 10:
|
||||
PRECACHE_SOUND( "plats/railmove1.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/railmove1.wav" );
|
||||
pszSound = "plats/railmove1.wav";
|
||||
break;
|
||||
case 11:
|
||||
PRECACHE_SOUND( "plats/squeekmove1.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/squeekmove1.wav" );
|
||||
pszSound = "plats/squeekmove1.wav";
|
||||
break;
|
||||
case 12:
|
||||
PRECACHE_SOUND( "plats/talkmove1.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/talkmove1.wav" );
|
||||
pszSound = "plats/talkmove1.wav";
|
||||
break;
|
||||
case 13:
|
||||
PRECACHE_SOUND( "plats/talkmove2.wav" );
|
||||
pev->noiseMoving = MAKE_STRING( "plats/talkmove2.wav" );
|
||||
pszSound = "plats/talkmove2.wav";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
pev->noiseMoving = MAKE_STRING( "common/null.wav" );
|
||||
pszSound = "common/null.wav";
|
||||
NullSound = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if( !NullSound )
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noiseMoving = MAKE_STRING( pszSound );
|
||||
NullSound = FALSE;
|
||||
|
||||
// set the plat's 'reached destination' stop sound
|
||||
switch( m_bStopSnd )
|
||||
{
|
||||
case 0:
|
||||
pev->noiseArrived = MAKE_STRING( "common/null.wav" );
|
||||
break;
|
||||
case 1:
|
||||
PRECACHE_SOUND( "plats/bigstop1.wav" );
|
||||
pev->noiseArrived = MAKE_STRING( "plats/bigstop1.wav" );
|
||||
pszSound = "plats/bigstop1.wav";
|
||||
break;
|
||||
case 2:
|
||||
PRECACHE_SOUND( "plats/bigstop2.wav" );
|
||||
pev->noiseArrived = MAKE_STRING( "plats/bigstop2.wav" );
|
||||
pszSound = "plats/bigstop2.wav";
|
||||
break;
|
||||
case 3:
|
||||
PRECACHE_SOUND( "plats/freightstop1.wav" );
|
||||
pev->noiseArrived = MAKE_STRING( "plats/freightstop1.wav" );
|
||||
pszSound = "plats/freightstop1.wav";
|
||||
break;
|
||||
case 4:
|
||||
PRECACHE_SOUND( "plats/heavystop2.wav" );
|
||||
pev->noiseArrived = MAKE_STRING( "plats/heavystop2.wav" );
|
||||
pszSound = "plats/heavystop2.wav";
|
||||
break;
|
||||
case 5:
|
||||
PRECACHE_SOUND( "plats/rackstop1.wav" );
|
||||
pev->noiseArrived = MAKE_STRING( "plats/rackstop1.wav" );
|
||||
pszSound = "plats/rackstop1.wav";
|
||||
break;
|
||||
case 6:
|
||||
PRECACHE_SOUND( "plats/railstop1.wav" );
|
||||
pev->noiseArrived = MAKE_STRING( "plats/railstop1.wav" );
|
||||
pszSound = "plats/railstop1.wav";
|
||||
break;
|
||||
case 7:
|
||||
PRECACHE_SOUND( "plats/squeekstop1.wav" );
|
||||
pev->noiseArrived = MAKE_STRING( "plats/squeekstop1.wav" );
|
||||
pszSound = "plats/squeekstop1.wav";
|
||||
break;
|
||||
case 8:
|
||||
PRECACHE_SOUND( "plats/talkstop1.wav" );
|
||||
pev->noiseArrived = MAKE_STRING( "plats/talkstop1.wav" );
|
||||
pszSound = "plats/talkstop1.wav";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
pev->noiseArrived = MAKE_STRING( "common/null.wav" );
|
||||
pszSound = "common/null.wav";
|
||||
NullSound = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if( !NullSound )
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noiseArrived = MAKE_STRING( pszSound );
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1482,6 +1471,8 @@ void CFuncTrackTrain::Spawn( void )
|
|||
|
||||
void CFuncTrackTrain::Precache( void )
|
||||
{
|
||||
const char *pszSound;
|
||||
|
||||
if( m_flVolume == 0.0 )
|
||||
m_flVolume = 1.0;
|
||||
|
||||
|
@ -1489,34 +1480,36 @@ void CFuncTrackTrain::Precache( void )
|
|||
{
|
||||
default:
|
||||
// no sound
|
||||
pev->noise = 0;
|
||||
pszSound = NULL;
|
||||
break;
|
||||
case 1:
|
||||
PRECACHE_SOUND( "plats/ttrain1.wav" );
|
||||
pev->noise = MAKE_STRING("plats/ttrain1.wav" );
|
||||
pszSound = "plats/ttrain1.wav";
|
||||
break;
|
||||
case 2:
|
||||
PRECACHE_SOUND( "plats/ttrain2.wav" );
|
||||
pev->noise = MAKE_STRING( "plats/ttrain2.wav" );
|
||||
pszSound = "plats/ttrain2.wav";
|
||||
break;
|
||||
case 3:
|
||||
PRECACHE_SOUND( "plats/ttrain3.wav" );
|
||||
pev->noise = MAKE_STRING( "plats/ttrain3.wav" );
|
||||
pszSound = "plats/ttrain3.wav";
|
||||
break;
|
||||
case 4:
|
||||
PRECACHE_SOUND( "plats/ttrain4.wav" );
|
||||
pev->noise = MAKE_STRING( "plats/ttrain4.wav" );
|
||||
pszSound = "plats/ttrain4.wav";
|
||||
break;
|
||||
case 5:
|
||||
PRECACHE_SOUND( "plats/ttrain6.wav" );
|
||||
pev->noise = MAKE_STRING( "plats/ttrain6.wav" );
|
||||
pszSound = "plats/ttrain6.wav";
|
||||
break;
|
||||
case 6:
|
||||
PRECACHE_SOUND( "plats/ttrain7.wav" );
|
||||
pev->noise = MAKE_STRING( "plats/ttrain7.wav" );
|
||||
pszSound = "plats/ttrain7.wav";
|
||||
break;
|
||||
}
|
||||
|
||||
if( !pszSound )
|
||||
{
|
||||
PRECACHE_SOUND( pszSound );
|
||||
pev->noise = MAKE_STRING( pszSound );
|
||||
}
|
||||
else
|
||||
pev->noise = 0;
|
||||
|
||||
PRECACHE_SOUND( "plats/ttrain_brake1.wav" );
|
||||
PRECACHE_SOUND( "plats/ttrain_start1.wav" );
|
||||
|
||||
|
|
|
@ -1689,7 +1689,7 @@ void NextLevel( void )
|
|||
// go back to start if no trigger_changelevel
|
||||
if( FNullEnt( pent ) )
|
||||
{
|
||||
gpGlobals->mapname = ALLOC_STRING( "start" );
|
||||
gpGlobals->mapname = MAKE_STRING( "start" );
|
||||
pChange = GetClassPtr( (CChangeLevel *)NULL );
|
||||
strcpy( pChange->m_szMapName, "start" );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue