2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-22 09:57:21 +01:00

Remove unneeded strcpy usage.

This commit is contained in:
Night Owl 2017-07-11 02:24:19 +05:00
parent 7bba3a124a
commit 1c1d9ae183
3 changed files with 11 additions and 12 deletions

View File

@ -283,7 +283,7 @@ unsigned short stub_PrecacheEvent( int type, const char *s )
return 0;
}
const char *stub_NameForFunction( unsigned int function )
const char *stub_NameForFunction( void *function )
{
return "func";
}

View File

@ -34,7 +34,7 @@ void HUD_SetMaxSpeed( const struct edict_s *ed, float speed );
int stub_PrecacheModel( const char* s );
int stub_PrecacheSound( const char* s );
unsigned short stub_PrecacheEvent( int type, const char *s );
const char *stub_NameForFunction( unsigned int function );
const char *stub_NameForFunction( void *function );
void stub_SetModel( struct edict_s *e, const char *m );
extern cvar_t *cl_lw;

View File

@ -1695,7 +1695,7 @@ void EV_TrainPitchAdjust( event_args_t *args )
int pitch;
int stop;
char sz[256];
const char *pszSound;
idx = args->entindex;
@ -1711,36 +1711,35 @@ void EV_TrainPitchAdjust( event_args_t *args )
switch( noise )
{
case 1:
strcpy( sz, "plats/ttrain1.wav" );
pszSound = "plats/ttrain1.wav";
break;
case 2:
strcpy( sz, "plats/ttrain2.wav" );
pszSound = "plats/ttrain2.wav";
break;
case 3:
strcpy( sz, "plats/ttrain3.wav" );
pszSound = "plats/ttrain3.wav";
break;
case 4:
strcpy( sz, "plats/ttrain4.wav");
pszSound = "plats/ttrain4.wav";
break;
case 5:
strcpy( sz, "plats/ttrain6.wav");
pszSound = "plats/ttrain6.wav";
break;
case 6:
strcpy( sz, "plats/ttrain7.wav");
pszSound = "plats/ttrain7.wav";
break;
default:
// no sound
strcpy( sz, "" );
return;
}
if( stop )
{
gEngfuncs.pEventAPI->EV_StopSound( idx, CHAN_STATIC, sz );
gEngfuncs.pEventAPI->EV_StopSound( idx, CHAN_STATIC, pszSound );
}
else
{
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_STATIC, sz, m_flVolume, ATTN_NORM, SND_CHANGE_PITCH, pitch );
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_STATIC, pszSound, m_flVolume, ATTN_NORM, SND_CHANGE_PITCH, pitch );
}
}