Browse Source

Remove unneeded strcpy usage.

halloween
Night Owl 8 years ago
parent
commit
1c1d9ae183
  1. 2
      cl_dll/com_weapons.cpp
  2. 2
      cl_dll/com_weapons.h
  3. 19
      cl_dll/ev_hldm.cpp

2
cl_dll/com_weapons.cpp

@ -283,7 +283,7 @@ unsigned short stub_PrecacheEvent( int type, const char *s ) @@ -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";
}

2
cl_dll/com_weapons.h

@ -34,7 +34,7 @@ void HUD_SetMaxSpeed( const struct edict_s *ed, float speed ); @@ -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;

19
cl_dll/ev_hldm.cpp

@ -1695,7 +1695,7 @@ void EV_TrainPitchAdjust( event_args_t *args ) @@ -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 ) @@ -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 );
}
}

Loading…
Cancel
Save