Browse Source

Remove unneeded casts.

halloween
Night Owl 7 years ago
parent
commit
49e740c6f1
  1. 14
      dlls/agrunt.cpp
  2. 2
      dlls/animation.cpp
  3. 16
      dlls/bmodels.cpp
  4. 26
      dlls/buttons.cpp
  5. 2
      dlls/cbase.cpp
  6. 28
      dlls/doors.cpp
  7. 25
      dlls/effects.cpp
  8. 8
      dlls/func_break.cpp
  9. 10
      dlls/func_tank.cpp
  10. 22
      dlls/gargantua.cpp
  11. 2
      dlls/genericmonster.cpp
  12. 10
      dlls/h_cycler.cpp
  13. 8
      dlls/islave.cpp
  14. 4
      dlls/leech.cpp
  15. 28
      dlls/multiplay_gamerules.cpp
  16. 8
      dlls/nodes.cpp
  17. 6
      dlls/nodes.h
  18. 40
      dlls/plats.cpp
  19. 6
      dlls/prop.cpp
  20. 4
      dlls/scripted.cpp
  21. 8
      dlls/sound.cpp
  22. 4
      dlls/stats.cpp
  23. 8
      dlls/triggers.cpp
  24. 10
      dlls/util.cpp
  25. 2
      dlls/util.h
  26. 8
      dlls/weapons.cpp
  27. 4
      dlls/world.cpp
  28. 6
      dlls/xen.cpp
  29. 14
      dlls/zombie.cpp

14
dlls/agrunt.cpp

@ -613,25 +613,25 @@ void CAGrunt::Precache() @@ -613,25 +613,25 @@ void CAGrunt::Precache()
PRECACHE_MODEL( "models/agrunt.mdl" );
for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackHitSounds[i] );
PRECACHE_SOUND( pAttackHitSounds[i] );
for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackMissSounds[i] );
PRECACHE_SOUND( pAttackMissSounds[i] );
for( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ )
PRECACHE_SOUND( (char *)pIdleSounds[i] );
PRECACHE_SOUND( pIdleSounds[i] );
for( i = 0; i < ARRAYSIZE( pDieSounds ); i++ )
PRECACHE_SOUND( (char *)pDieSounds[i] );
PRECACHE_SOUND( pDieSounds[i] );
for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ )
PRECACHE_SOUND( (char *)pPainSounds[i] );
PRECACHE_SOUND( pPainSounds[i] );
for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackSounds[i] );
PRECACHE_SOUND( pAttackSounds[i] );
for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ )
PRECACHE_SOUND( (char *)pAlertSounds[i] );
PRECACHE_SOUND( pAlertSounds[i] );
PRECACHE_SOUND( "hassault/hw_shoot1.wav" );

2
dlls/animation.cpp

@ -208,7 +208,7 @@ void SequencePrecache( void *pmodel, const char *pSequenceName ) @@ -208,7 +208,7 @@ void SequencePrecache( void *pmodel, const char *pSequenceName )
ALERT( at_error, "Bad sound event %d in sequence %s :: %s (sound is \"%s\")\n", pevent[i].event, pstudiohdr->name, pSequenceName, pevent[i].options );
}
PRECACHE_SOUND( (char *)( gpGlobals->pStringBase + ALLOC_STRING( pevent[i].options ) ) );
PRECACHE_SOUND( gpGlobals->pStringBase + ALLOC_STRING( pevent[i].options ) );
}
}
}

16
dlls/bmodels.cpp

@ -402,7 +402,7 @@ void CFuncRotating::Spawn() @@ -402,7 +402,7 @@ void CFuncRotating::Spawn()
}
UTIL_SetOrigin( pev, pev->origin );
SET_MODEL( ENT(pev), STRING(pev->model) );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
SetUse( &CFuncRotating::RotatingUse );
// did level designer forget to assign speed?
@ -538,7 +538,7 @@ void CFuncRotating::RampPitchVol( int fUp ) @@ -538,7 +538,7 @@ void CFuncRotating::RampPitchVol( int fUp )
pitch = PITCH_NORM - 1;
// change the fan's vol and pitch
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, (char *)STRING( pev->noiseRunning ),
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, STRING( pev->noiseRunning ),
fvol, m_flAttenuation, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch );
}
@ -560,7 +560,7 @@ void CFuncRotating::SpinUp( void ) @@ -560,7 +560,7 @@ void CFuncRotating::SpinUp( void )
fabs( vecAVel.z ) >= fabs( pev->movedir.z * pev->speed ) )
{
pev->avelocity = pev->movedir * pev->speed;// set speed in case we overshot
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, (char *)STRING( pev->noiseRunning ),
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, STRING( pev->noiseRunning ),
m_flVolume, m_flAttenuation, SND_CHANGE_PITCH | SND_CHANGE_VOL, FANPITCHMAX );
SetThink( &CFuncRotating::Rotate );
@ -601,7 +601,7 @@ void CFuncRotating::SpinDown( void ) @@ -601,7 +601,7 @@ void CFuncRotating::SpinDown( void )
pev->avelocity = g_vecZero;// set speed in case we overshot
// stop sound, we're done
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, (char *)STRING( pev->noiseRunning /* Stop */ ),
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, STRING( pev->noiseRunning /* Stop */ ),
0, 0, SND_STOP, (int)m_pitch );
SetThink( &CFuncRotating::Rotate );
@ -630,7 +630,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller, @@ -630,7 +630,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller,
if( pev->avelocity != g_vecZero )
{
SetThink( &CFuncRotating::SpinDown );
//EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, (char *)STRING( pev->noiseStop ),
//EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, STRING( pev->noiseStop ),
// m_flVolume, m_flAttenuation, 0, m_pitch );
pev->nextthink = pev->ltime + 0.1;
@ -638,7 +638,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller, @@ -638,7 +638,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller,
else// fan is not moving, so start it
{
SetThink( &CFuncRotating::SpinUp );
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, (char *)STRING( pev->noiseRunning ),
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, STRING( pev->noiseRunning ),
0.01, m_flAttenuation, 0, FANPITCHMIN );
pev->nextthink = pev->ltime + 0.1;
@ -651,7 +651,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller, @@ -651,7 +651,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller,
// play stopping sound here
SetThink( &CFuncRotating::SpinDown );
// EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, (char *)STRING( pev->noiseStop ),
// EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, STRING( pev->noiseStop ),
// m_flVolume, m_flAttenuation, 0, m_pitch );
pev->nextthink = pev->ltime + 0.1;
@ -659,7 +659,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller, @@ -659,7 +659,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller,
}
else
{
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, (char *)STRING( pev->noiseRunning ),
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, STRING( pev->noiseRunning ),
m_flVolume, m_flAttenuation, 0, FANPITCHMAX );
pev->avelocity = pev->movedir * pev->speed;

26
dlls/buttons.cpp

@ -343,25 +343,25 @@ void CBaseButton::Precache( void ) @@ -343,25 +343,25 @@ void CBaseButton::Precache( void )
m_ls.sUnlockedSentence = MAKE_STRING( "EA" );
break;
case 2: // security door
m_ls.sUnlockedSentence = MAKE_STRING("ED");
m_ls.sUnlockedSentence = MAKE_STRING( "ED" );
break;
case 3: // blast door
m_ls.sUnlockedSentence = MAKE_STRING("EF");
m_ls.sUnlockedSentence = MAKE_STRING( "EF" );
break;
case 4: // fire door
m_ls.sUnlockedSentence = MAKE_STRING("EFIRE");
m_ls.sUnlockedSentence = MAKE_STRING( "EFIRE" );
break;
case 5: // chemical door
m_ls.sUnlockedSentence = MAKE_STRING("ECHEM");
m_ls.sUnlockedSentence = MAKE_STRING( "ECHEM" );
break;
case 6: // radiation door
m_ls.sUnlockedSentence = MAKE_STRING("ERAD");
m_ls.sUnlockedSentence = MAKE_STRING( "ERAD" );
break;
case 7: // gen containment
m_ls.sUnlockedSentence = MAKE_STRING("ECON");
m_ls.sUnlockedSentence = MAKE_STRING( "ECON" );
break;
case 8: // maintenance door
m_ls.sUnlockedSentence = MAKE_STRING("EH");
m_ls.sUnlockedSentence = MAKE_STRING( "EH" );
break;
default:
m_ls.sUnlockedSentence = 0;
@ -426,7 +426,7 @@ int CBaseButton::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl @@ -426,7 +426,7 @@ int CBaseButton::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl
if( code == BUTTON_RETURN )
{
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noise ), 1, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1, ATTN_NORM );
// Toggle buttons fire when they get back to their "home" position
if( !( pev->spawnflags & SF_BUTTON_TOGGLE ) )
@ -657,7 +657,7 @@ void CBaseButton::ButtonUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ @@ -657,7 +657,7 @@ void CBaseButton::ButtonUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_
{
if( !m_fStayPushed && FBitSet( pev->spawnflags, SF_BUTTON_TOGGLE ) )
{
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noise ), 1, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1, ATTN_NORM );
//SUB_UseTargets( m_eoActivator );
ButtonReturn();
@ -716,7 +716,7 @@ void CBaseButton::ButtonTouch( CBaseEntity *pOther ) @@ -716,7 +716,7 @@ void CBaseButton::ButtonTouch( CBaseEntity *pOther )
if( code == BUTTON_RETURN )
{
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noise ), 1, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1, ATTN_NORM );
SUB_UseTargets( m_hActivator, USE_TOGGLE, 0 );
ButtonReturn();
}
@ -729,7 +729,7 @@ void CBaseButton::ButtonTouch( CBaseEntity *pOther ) @@ -729,7 +729,7 @@ void CBaseButton::ButtonTouch( CBaseEntity *pOther )
//
void CBaseButton::ButtonActivate()
{
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noise ), 1, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1, ATTN_NORM );
if( !UTIL_IsMasterTriggered( m_sMaster, m_hActivator ) )
{
@ -815,7 +815,7 @@ void CBaseButton::ButtonBackHome( void ) @@ -815,7 +815,7 @@ void CBaseButton::ButtonBackHome( void )
if( FBitSet( pev->spawnflags, SF_BUTTON_TOGGLE ) )
{
//EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noise ), 1, ATTN_NORM );
//EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1, ATTN_NORM );
SUB_UseTargets( m_hActivator, USE_TOGGLE, 0 );
}
@ -1034,7 +1034,7 @@ void CMomentaryRotButton::KeyValue( KeyValueData *pkvd ) @@ -1034,7 +1034,7 @@ void CMomentaryRotButton::KeyValue( KeyValueData *pkvd )
void CMomentaryRotButton::PlaySound( void )
{
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noise ), 1, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1, ATTN_NORM );
}
// BUGBUG: This design causes a latentcy. When the button is retriggered, the first impulse

2
dlls/cbase.cpp

@ -605,7 +605,7 @@ int CBaseEntity::Restore( CRestore &restore ) @@ -605,7 +605,7 @@ int CBaseEntity::Restore( CRestore &restore )
mins = pev->mins; // Set model is about to destroy these
maxs = pev->maxs;
PRECACHE_MODEL( (char *)STRING( pev->model ) );
PRECACHE_MODEL( STRING( pev->model ) );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
UTIL_SetSize( pev, mins, maxs ); // Reset them
}

28
dlls/doors.cpp

@ -127,7 +127,7 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton @@ -127,7 +127,7 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton
if( fplaysound )
{
// play 'door locked' sound
EMIT_SOUND( ENT( pev ), CHAN_ITEM, (char*)STRING( pls->sLockedSound ), fvol, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_ITEM, STRING( pls->sLockedSound ), fvol, ATTN_NORM );
pls->flwaitSound = gpGlobals->time + flsoundwait;
}
@ -164,7 +164,7 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton @@ -164,7 +164,7 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton
// play 'door unlocked' sound if set
if( fplaysound )
{
EMIT_SOUND( ENT( pev ), CHAN_ITEM, (char*)STRING( pls->sUnlockedSound ), fvol, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_ITEM, STRING( pls->sUnlockedSound ), fvol, ATTN_NORM );
pls->flwaitSound = gpGlobals->time + flsoundwait;
}
@ -606,7 +606,7 @@ void CBaseDoor::DoorGoUp( void ) @@ -606,7 +606,7 @@ void CBaseDoor::DoorGoUp( void )
// filter them out and leave a client stuck with looping door sounds!
if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) )
if( m_toggle_state != TS_GOING_UP && m_toggle_state != TS_GOING_DOWN )
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ), 1, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1, ATTN_NORM );
m_toggle_state = TS_GOING_UP;
@ -646,8 +646,8 @@ void CBaseDoor::DoorHitTop( void ) @@ -646,8 +646,8 @@ void CBaseDoor::DoorHitTop( void )
{
if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) )
{
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseArrived ), 1, ATTN_NORM );
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM );
}
ASSERT( m_toggle_state == TS_GOING_UP );
@ -686,7 +686,7 @@ void CBaseDoor::DoorGoDown( void ) @@ -686,7 +686,7 @@ void CBaseDoor::DoorGoDown( void )
{
if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) )
if( m_toggle_state != TS_GOING_UP && m_toggle_state != TS_GOING_DOWN )
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ), 1, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1, ATTN_NORM );
#ifdef DOOR_ASSERT
ASSERT( m_toggle_state == TS_AT_TOP );
#endif // DOOR_ASSERT
@ -706,8 +706,8 @@ void CBaseDoor::DoorHitBottom( void ) @@ -706,8 +706,8 @@ void CBaseDoor::DoorHitBottom( void )
{
if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) )
{
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseArrived ), 1, ATTN_NORM );
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM );
}
ASSERT( m_toggle_state == TS_GOING_DOWN );
@ -751,7 +751,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther ) @@ -751,7 +751,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther )
{
// BMod Start - Door sound fix.
if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) )
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) );
// BMod End
if( m_toggle_state == TS_GOING_DOWN )
@ -767,7 +767,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther ) @@ -767,7 +767,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther )
// Block all door pieces with the same targetname here.
if( !FStringNull( pev->targetname ) )
{
for(;;)
for( ; ; )
{
pentTarget = FIND_ENTITY_BY_TARGETNAME( pentTarget, STRING( pev->targetname ) );
@ -799,7 +799,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther ) @@ -799,7 +799,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther )
}
}
if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) )
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) );
if( pDoor->m_toggle_state == TS_GOING_DOWN )
pDoor->DoorGoUp();
@ -1106,7 +1106,7 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP @@ -1106,7 +1106,7 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
// This entity only thinks when it moves, so if it's thinking, it's in the process of moving
// play the sound when it starts moving(not yet thinking)
if( pev->nextthink < pev->ltime || pev->nextthink == 0 )
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ), 1, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1, ATTN_NORM );
// If we already moving to designated point, return
else if( move == m_vecFinalDest )
return;
@ -1118,6 +1118,6 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP @@ -1118,6 +1118,6 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
void CMomentaryDoor::MomentaryMoveDone( void )
{
STOP_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseMoving ) );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, (char*)STRING( pev->noiseArrived ), 1, ATTN_NORM );
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) );
EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM );
}

25
dlls/effects.cpp

@ -229,7 +229,7 @@ void CBeam::BeamInit( const char *pSpriteName, int width ) @@ -229,7 +229,7 @@ void CBeam::BeamInit( const char *pSpriteName, int width )
SetFrame( 0 );
SetScrollRate( 0 );
pev->model = MAKE_STRING( pSpriteName );
SetTexture( PRECACHE_MODEL( (char *)pSpriteName ) );
SetTexture( PRECACHE_MODEL( pSpriteName ) );
SetWidth( width );
pev->skin = 0;
pev->sequence = 0;
@ -486,7 +486,7 @@ void CLightning::Spawn( void ) @@ -486,7 +486,7 @@ void CLightning::Spawn( void )
void CLightning::Precache( void )
{
m_spriteTexture = PRECACHE_MODEL( (char *)STRING( m_iszSpriteName ) );
m_spriteTexture = PRECACHE_MODEL( STRING( m_iszSpriteName ) );
CBeam::Precache();
}
@ -954,9 +954,9 @@ void CLaser::Spawn( void ) @@ -954,9 +954,9 @@ void CLaser::Spawn( void )
void CLaser::Precache( void )
{
pev->modelindex = PRECACHE_MODEL( (char *)STRING( pev->model ) );
pev->modelindex = PRECACHE_MODEL( STRING( pev->model ) );
if( m_iszSpriteName )
PRECACHE_MODEL( (char *)STRING( m_iszSpriteName ) );
PRECACHE_MODEL( STRING( m_iszSpriteName ) );
}
void CLaser::KeyValue( KeyValueData *pkvd )
@ -1100,7 +1100,7 @@ void CGlow::Spawn( void ) @@ -1100,7 +1100,7 @@ void CGlow::Spawn( void )
pev->effects = 0;
pev->frame = 0;
PRECACHE_MODEL( (char *)STRING( pev->model ) );
PRECACHE_MODEL( STRING( pev->model ) );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1;
@ -1160,7 +1160,7 @@ void CSprite::Spawn( void ) @@ -1160,7 +1160,7 @@ void CSprite::Spawn( void )
void CSprite::Precache( void )
{
PRECACHE_MODEL( (char *)STRING( pev->model ) );
PRECACHE_MODEL( STRING( pev->model ) );
// Reset attachment after save/restore
if( pev->aiment )
@ -1515,7 +1515,7 @@ void CEnvShooter::KeyValue( KeyValueData *pkvd ) @@ -1515,7 +1515,7 @@ void CEnvShooter::KeyValue( KeyValueData *pkvd )
void CEnvShooter::Precache( void )
{
m_iGibModelIndex = PRECACHE_MODEL( (char *)STRING( pev->model ) );
m_iGibModelIndex = PRECACHE_MODEL( STRING( pev->model ) );
CBreakable::MaterialSoundPrecache( (Materials)m_iGibMaterial );
}
@ -2005,7 +2005,7 @@ void CMessage::Spawn( void ) @@ -2005,7 +2005,7 @@ void CMessage::Spawn( void )
void CMessage::Precache( void )
{
if( pev->noise )
PRECACHE_SOUND( (char *)STRING( pev->noise ) );
PRECACHE_SOUND( STRING( pev->noise ) );
}
void CMessage::KeyValue( KeyValueData *pkvd )
@ -2040,16 +2040,15 @@ void CMessage::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useT @@ -2040,16 +2040,15 @@ void CMessage::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useT
if( pActivator && pActivator->IsPlayer() )
pPlayer = pActivator;
else
{
pPlayer = CBaseEntity::Instance( g_engfuncs.pfnPEntityOfEntIndex( 1 ) );
}
if( pPlayer )
UTIL_ShowMessage( STRING( pev->message ), pPlayer );
}
if( pev->noise )
{
EMIT_SOUND( edict(), CHAN_BODY, STRING( pev->noise ), pev->scale, pev->speed );
}
if( pev->spawnflags & SF_MESSAGE_ONCE )
UTIL_Remove( this );
@ -2071,7 +2070,7 @@ public: @@ -2071,7 +2070,7 @@ public:
void CEnvFunnel::Precache( void )
{
m_iSprite = PRECACHE_MODEL ( "sprites/flare6.spr" );
m_iSprite = PRECACHE_MODEL( "sprites/flare6.spr" );
}
LINK_ENTITY_TO_CLASS( env_funnel, CEnvFunnel )

8
dlls/func_break.cpp

@ -259,7 +259,7 @@ void CBreakable::MaterialSoundPrecache( Materials precacheMaterial ) @@ -259,7 +259,7 @@ void CBreakable::MaterialSoundPrecache( Materials precacheMaterial )
for( i = 0; i < soundCount; i++ )
{
PRECACHE_SOUND( (char *)pSoundList[i] );
PRECACHE_SOUND( pSoundList[i] );
}
}
@ -340,11 +340,11 @@ void CBreakable::Precache( void ) @@ -340,11 +340,11 @@ void CBreakable::Precache( void )
if( m_iszGibModel )
pGibName = STRING( m_iszGibModel );
m_idShard = PRECACHE_MODEL( (char *)pGibName );
m_idShard = PRECACHE_MODEL( pGibName );
// Precache the spawn item's data
if( m_iszSpawnObject )
UTIL_PrecacheOther( (char *)STRING( m_iszSpawnObject ) );
UTIL_PrecacheOther( STRING( m_iszSpawnObject ) );
}
// play shard sound when func_breakable takes damage.
@ -746,7 +746,7 @@ void CBreakable::Die( void ) @@ -746,7 +746,7 @@ void CBreakable::Die( void )
SetThink( &CBaseEntity::SUB_Remove );
pev->nextthink = pev->ltime + 0.1;
if( m_iszSpawnObject )
CBaseEntity::Create( (char *)STRING( m_iszSpawnObject ), VecBModelOrigin( pev ), pev->angles, edict() );
CBaseEntity::Create( STRING( m_iszSpawnObject ), VecBModelOrigin( pev ), pev->angles, edict() );
if( Explodable() )
{

10
dlls/func_tank.cpp

@ -200,13 +200,13 @@ void CFuncTank::Spawn( void ) @@ -200,13 +200,13 @@ void CFuncTank::Spawn( void )
void CFuncTank::Precache( void )
{
if( m_iszSpriteSmoke )
PRECACHE_MODEL( (char *)STRING( m_iszSpriteSmoke ) );
PRECACHE_MODEL( STRING( m_iszSpriteSmoke ) );
if( m_iszSpriteFlash )
PRECACHE_MODEL( (char *)STRING( m_iszSpriteFlash ) );
PRECACHE_MODEL( STRING( m_iszSpriteFlash ) );
if( pev->noise )
PRECACHE_SOUND( (char *)STRING( pev->noise ) );
PRECACHE_SOUND( STRING( pev->noise ) );
}
void CFuncTank::KeyValue( KeyValueData *pkvd )
@ -688,13 +688,13 @@ void CFuncTank::StartRotSound( void ) @@ -688,13 +688,13 @@ void CFuncTank::StartRotSound( void )
if( !pev->noise || ( pev->spawnflags & SF_TANK_SOUNDON ) )
return;
pev->spawnflags |= SF_TANK_SOUNDON;
EMIT_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noise ), 0.85, ATTN_NORM );
EMIT_SOUND( edict(), CHAN_STATIC, STRING( pev->noise ), 0.85, ATTN_NORM );
}
void CFuncTank::StopRotSound( void )
{
if( pev->spawnflags & SF_TANK_SOUNDON )
STOP_SOUND( edict(), CHAN_STATIC, (char*)STRING( pev->noise ) );
STOP_SOUND( edict(), CHAN_STATIC, STRING( pev->noise ) );
pev->spawnflags &= ~SF_TANK_SOUNDON;
}

22
dlls/gargantua.cpp

@ -770,37 +770,37 @@ void CGargantua::Precache() @@ -770,37 +770,37 @@ void CGargantua::Precache()
PRECACHE_SOUND( GARG_STOMP_BUZZ_SOUND );
for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackHitSounds[i] );
PRECACHE_SOUND( pAttackHitSounds[i] );
for( i = 0; i < ARRAYSIZE( pBeamAttackSounds ); i++ )
PRECACHE_SOUND( (char *)pBeamAttackSounds[i] );
PRECACHE_SOUND( pBeamAttackSounds[i] );
for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackMissSounds[i] );
PRECACHE_SOUND( pAttackMissSounds[i] );
for( i = 0; i < ARRAYSIZE( pRicSounds ); i++ )
PRECACHE_SOUND( (char *)pRicSounds[i] );
PRECACHE_SOUND( pRicSounds[i] );
for( i = 0; i < ARRAYSIZE( pFootSounds ); i++ )
PRECACHE_SOUND( (char *)pFootSounds[i] );
PRECACHE_SOUND( pFootSounds[i] );
for( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ )
PRECACHE_SOUND( (char *)pIdleSounds[i] );
PRECACHE_SOUND( pIdleSounds[i] );
for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ )
PRECACHE_SOUND((char *)pAlertSounds[i]);
PRECACHE_SOUND( pAlertSounds[i] );
for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ )
PRECACHE_SOUND( (char *)pPainSounds[i] );
PRECACHE_SOUND( pPainSounds[i] );
for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackSounds[i] );
PRECACHE_SOUND( pAttackSounds[i] );
for( i = 0; i < ARRAYSIZE( pStompSounds ); i++ )
PRECACHE_SOUND( (char *)pStompSounds[i] );
PRECACHE_SOUND( pStompSounds[i] );
for( i = 0; i < ARRAYSIZE( pBreatheSounds ); i++ )
PRECACHE_SOUND( (char *)pBreatheSounds[i] );
PRECACHE_SOUND( pBreatheSounds[i] );
}
void CGargantua::UpdateOnRemove()

2
dlls/genericmonster.cpp

@ -131,7 +131,7 @@ void CGenericMonster::Spawn() @@ -131,7 +131,7 @@ void CGenericMonster::Spawn()
//=========================================================
void CGenericMonster::Precache()
{
PRECACHE_MODEL( (char *)STRING( pev->model ) );
PRECACHE_MODEL( STRING( pev->model ) );
}
//=========================================================

10
dlls/h_cycler.cpp

@ -67,7 +67,7 @@ class CGenericCycler : public CCycler @@ -67,7 +67,7 @@ class CGenericCycler : public CCycler
public:
void Spawn( void )
{
GenericCyclerSpawn( (char *)STRING( pev->model ), Vector( -16, -16, 0 ), Vector( 16, 16, 72 ) );
GenericCyclerSpawn( STRING( pev->model ), Vector( -16, -16, 0 ), Vector( 16, 16, 72 ) );
}
};
@ -255,7 +255,7 @@ void CCyclerSprite::Spawn( void ) @@ -255,7 +255,7 @@ void CCyclerSprite::Spawn( void )
m_animate = 1;
m_lastTime = gpGlobals->time;
PRECACHE_MODEL( (char *)STRING( pev->model ) );
PRECACHE_MODEL( STRING( pev->model ) );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
m_maxFrame = (float)MODEL_FRAMES( pev->modelindex ) - 1;
@ -314,7 +314,7 @@ void CWeaponCycler::Spawn() @@ -314,7 +314,7 @@ void CWeaponCycler::Spawn()
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE;
PRECACHE_MODEL( (char *)STRING( pev->model ) );
PRECACHE_MODEL( STRING( pev->model ) );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
m_iszModel = pev->model;
m_iModel = pev->modelindex;
@ -401,7 +401,7 @@ void CWreckage::Spawn( void ) @@ -401,7 +401,7 @@ void CWreckage::Spawn( void )
if( pev->model )
{
PRECACHE_MODEL( (char *)STRING( pev->model ) );
PRECACHE_MODEL( STRING( pev->model ) );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
}
// pev->scale = 5.0;
@ -412,7 +412,7 @@ void CWreckage::Spawn( void ) @@ -412,7 +412,7 @@ void CWreckage::Spawn( void )
void CWreckage::Precache()
{
if( pev->model )
PRECACHE_MODEL( (char *)STRING( pev->model ) );
PRECACHE_MODEL( STRING( pev->model ) );
}
void CWreckage::Think( void )

8
dlls/islave.cpp

@ -544,16 +544,16 @@ void CISlave::Precache() @@ -544,16 +544,16 @@ void CISlave::Precache()
PRECACHE_SOUND( "weapons/cbar_miss1.wav" );
for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackHitSounds[i] );
PRECACHE_SOUND( pAttackHitSounds[i] );
for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackMissSounds[i] );
PRECACHE_SOUND( pAttackMissSounds[i] );
for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ )
PRECACHE_SOUND((char *)pPainSounds[i] );
PRECACHE_SOUND( pPainSounds[i] );
for( i = 0; i < ARRAYSIZE( pDeathSounds ); i++ )
PRECACHE_SOUND( (char *)pDeathSounds[i] );
PRECACHE_SOUND( pDeathSounds[i] );
UTIL_PrecacheOther( "test_effect" );
}

4
dlls/leech.cpp

@ -277,9 +277,9 @@ void CLeech::Precache( void ) @@ -277,9 +277,9 @@ void CLeech::Precache( void )
PRECACHE_MODEL( "models/leech.mdl" );
for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackSounds[i] );
PRECACHE_SOUND( pAttackSounds[i] );
for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ )
PRECACHE_SOUND( (char *)pAlertSounds[i] );
PRECACHE_SOUND( pAlertSounds[i] );
}
int CLeech::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType )

28
dlls/multiplay_gamerules.cpp

@ -92,7 +92,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay() @@ -92,7 +92,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay()
if( IS_DEDICATED_SERVER() )
{
// dedicated server
/*char *servercfgfile = (char *)CVAR_GET_STRING( "servercfgfile" );
/*const char *servercfgfile = CVAR_GET_STRING( "servercfgfile" );
if( servercfgfile && servercfgfile[0] )
{
@ -108,7 +108,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay() @@ -108,7 +108,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay()
else
{
// listen server
char *lservercfgfile = (char *)CVAR_GET_STRING( "lservercfgfile" );
const char *lservercfgfile = CVAR_GET_STRING( "lservercfgfile" );
if( lservercfgfile && lservercfgfile[0] )
{
@ -1214,7 +1214,7 @@ COM_Parse @@ -1214,7 +1214,7 @@ COM_Parse
Parse a token out of a string
==============
*/
char *COM_Parse( char *data )
const char *COM_Parse( const char *data )
{
int c;
int len;
@ -1290,9 +1290,9 @@ COM_TokenWaiting @@ -1290,9 +1290,9 @@ COM_TokenWaiting
Returns 1 if additional data is waiting to be processed on this line
==============
*/
int COM_TokenWaiting( char *buffer )
int COM_TokenWaiting( const char *buffer )
{
char *p;
const char *p;
p = buffer;
while( *p && *p!='\n')
@ -1313,12 +1313,12 @@ ReloadMapCycleFile @@ -1313,12 +1313,12 @@ ReloadMapCycleFile
Parses mapcycle.txt file into mapcycle_t structure
==============
*/
int ReloadMapCycleFile( char *filename, mapcycle_t *cycle )
int ReloadMapCycleFile( const char *filename, mapcycle_t *cycle )
{
char szMap[32];
int length;
char *pFileList;
char *aFileList = pFileList = (char*)LOAD_FILE_FOR_ME( filename, &length );
const char *pFileList;
const char *aFileList = pFileList = (const char *)LOAD_FILE_FOR_ME( filename, &length );
int hasbuffer;
mapcycle_item_s *item, *newlist = NULL, *next;
@ -1396,7 +1396,7 @@ int ReloadMapCycleFile( char *filename, mapcycle_t *cycle ) @@ -1396,7 +1396,7 @@ int ReloadMapCycleFile( char *filename, mapcycle_t *cycle )
}
}
FREE_FILE( aFileList );
FREE_FILE( (void*)aFileList );
}
// Fixup circular list pointer
@ -1532,7 +1532,7 @@ void CHalfLifeMultiplay::ChangeLevel( void ) @@ -1532,7 +1532,7 @@ void CHalfLifeMultiplay::ChangeLevel( void )
BOOL do_cycle = TRUE;
// find the map to change to
char *mapcfile = (char*)CVAR_GET_STRING( "mapcyclefile" );
const char *mapcfile = CVAR_GET_STRING( "mapcyclefile" );
ASSERT( mapcfile != NULL );
szCommands[0] = '\0';
@ -1650,8 +1650,8 @@ void CHalfLifeMultiplay::SendMOTDToClient( edict_t *client ) @@ -1650,8 +1650,8 @@ void CHalfLifeMultiplay::SendMOTDToClient( edict_t *client )
{
// read from the MOTD.txt file
int length, char_count = 0;
char *pFileList;
char *aFileList = pFileList = (char*)LOAD_FILE_FOR_ME( (char *)CVAR_GET_STRING( "motdfile" ), &length );
const char *pFileList;
const char *aFileList = pFileList = (const char*)LOAD_FILE_FOR_ME( CVAR_GET_STRING( "motdfile" ), &length );
// send the server name
MESSAGE_BEGIN( MSG_ONE, gmsgServerName, NULL, client );
@ -1679,7 +1679,7 @@ void CHalfLifeMultiplay::SendMOTDToClient( edict_t *client ) @@ -1679,7 +1679,7 @@ void CHalfLifeMultiplay::SendMOTDToClient( edict_t *client )
if( char_count < MAX_MOTD_LENGTH )
pFileList = aFileList + char_count;
else
*pFileList = 0;
pFileList = 0;
MESSAGE_BEGIN( MSG_ONE, gmsgMOTD, NULL, client );
WRITE_BYTE( *pFileList ? FALSE : TRUE ); // FALSE means there is still more message to come
@ -1687,5 +1687,5 @@ void CHalfLifeMultiplay::SendMOTDToClient( edict_t *client ) @@ -1687,5 +1687,5 @@ void CHalfLifeMultiplay::SendMOTDToClient( edict_t *client )
MESSAGE_END();
}
FREE_FILE( aFileList );
FREE_FILE( (void*)aFileList );
}

8
dlls/nodes.cpp

@ -2108,7 +2108,7 @@ void CTestHull::BuildNodeGraph( void ) @@ -2108,7 +2108,7 @@ void CTestHull::BuildNodeGraph( void )
WorldGraph.ComputeStaticRoutingTables();
// save the node graph for this level
WorldGraph.FSaveGraph( (char *)STRING( gpGlobals->mapname ) );
WorldGraph.FSaveGraph( STRING( gpGlobals->mapname ) );
ALERT( at_console, "Done.\n" );
}
@ -2363,7 +2363,7 @@ void CQueuePriority::Heap_SiftUp( void ) @@ -2363,7 +2363,7 @@ void CQueuePriority::Heap_SiftUp( void )
// will be loaded. If file cannot be loaded, the node tree
// will be created and saved to disk.
//=========================================================
int CGraph::FLoadGraph( char *szMapName )
int CGraph::FLoadGraph( const char *szMapName )
{
char szFilename[MAX_PATH];
int iVersion;
@ -2542,7 +2542,7 @@ NoMemory: @@ -2542,7 +2542,7 @@ NoMemory:
// CGraph - FSaveGraph - It's not rocket science.
// this WILL overwrite existing files.
//=========================================================
int CGraph::FSaveGraph( char *szMapName )
int CGraph::FSaveGraph( const char *szMapName )
{
int iVersion = GRAPH_VERSION;
char szFilename[MAX_PATH];
@ -2674,7 +2674,7 @@ int CGraph::FSetGraphPointers( void ) @@ -2674,7 +2674,7 @@ int CGraph::FSetGraphPointers( void )
// though. ( I now suspect that we are getting GMT back from
// these functions and must compensate for local time ) (sjb)
//=========================================================
int CGraph::CheckNODFile( char *szMapName )
int CGraph::CheckNODFile( const char *szMapName )
{
int retValue;

6
dlls/nodes.h

@ -182,9 +182,9 @@ public: @@ -182,9 +182,9 @@ public:
void InitGraph( void );
int AllocNodes ( void );
int CheckNODFile(char *szMapName);
int FLoadGraph(char *szMapName);
int FSaveGraph(char *szMapName);
int CheckNODFile(const char *szMapName);
int FLoadGraph(const char *szMapName);
int FSaveGraph(const char *szMapName);
int FSetGraphPointers(void);
void CheckNode(Vector vecOrigin, int iNode);

40
dlls/plats.cpp

@ -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;

6
dlls/prop.cpp

@ -248,7 +248,7 @@ void CProp::MaterialSoundPrecache( Materials precacheMaterial ) @@ -248,7 +248,7 @@ void CProp::MaterialSoundPrecache( Materials precacheMaterial )
for( i = 0; i < soundCount; i++ )
{
PRECACHE_SOUND( (char *)pSoundList[i] );
PRECACHE_SOUND( pSoundList[i] );
}
}
@ -327,8 +327,8 @@ void CProp::Precache( void ) @@ -327,8 +327,8 @@ void CProp::Precache( void )
if( m_iszGibModel )
pGibName = STRING( m_iszGibModel );
m_idShard = PRECACHE_MODEL( (char *)pGibName );
PRECACHE_MODEL( (char *)STRING( pev->model ) );
m_idShard = PRECACHE_MODEL( pGibName );
PRECACHE_MODEL( STRING( pev->model ) );
}
void CProp::DamageSound( void )

4
dlls/scripted.cpp

@ -712,7 +712,7 @@ void CCineMonster::DelayStart( int state ) @@ -712,7 +712,7 @@ void CCineMonster::DelayStart( int state )
else
{
pTarget->m_iDelay--;
if (pTarget->m_iDelay <= 0)
if( pTarget->m_iDelay <= 0 )
pTarget->m_startTime = gpGlobals->time + 0.05;
}
}
@ -1177,7 +1177,7 @@ void CFurniture::Die( void ) @@ -1177,7 +1177,7 @@ void CFurniture::Die( void )
//=========================================================
void CFurniture::Spawn()
{
PRECACHE_MODEL( (char *)STRING( pev->model ) );
PRECACHE_MODEL( STRING( pev->model ) );
SET_MODEL( ENT( pev ), STRING( pev->model ) );
pev->movetype = MOVETYPE_NONE;

8
dlls/sound.cpp

@ -182,7 +182,7 @@ void CAmbientGeneric::Spawn( void ) @@ -182,7 +182,7 @@ void CAmbientGeneric::Spawn( void )
m_flAttenuation = ATTN_STATIC;
}
char* szSoundFile = (char*)STRING( pev->message );
const char *szSoundFile = STRING( pev->message );
if( FStringNull( pev->message ) || strlen( szSoundFile ) < 1 )
{
@ -216,7 +216,7 @@ void CAmbientGeneric::Spawn( void ) @@ -216,7 +216,7 @@ void CAmbientGeneric::Spawn( void )
void CAmbientGeneric::Precache( void )
{
char* szSoundFile = (char*)STRING( pev->message );
const char *szSoundFile = STRING( pev->message );
if( !FStringNull( pev->message ) && strlen( szSoundFile ) > 1 )
{
@ -248,7 +248,7 @@ void CAmbientGeneric::Precache( void ) @@ -248,7 +248,7 @@ void CAmbientGeneric::Precache( void )
// with lfo if active.
void CAmbientGeneric::RampThink( void )
{
char* szSoundFile = (char*) STRING(pev->message);
const char *szSoundFile = STRING( pev->message );
int pitch = m_dpv.pitch;
int vol = m_dpv.vol;
int flags = 0;
@ -533,7 +533,7 @@ void CAmbientGeneric::InitModulationParms( void ) @@ -533,7 +533,7 @@ void CAmbientGeneric::InitModulationParms( void )
//
void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
char* szSoundFile = (char*)STRING( pev->message );
const char *szSoundFile = STRING( pev->message );
float fraction;
if( useType != USE_TOGGLE )

4
dlls/stats.cpp

@ -48,7 +48,7 @@ float AmmoDamage( const char *pName ) @@ -48,7 +48,7 @@ float AmmoDamage( const char *pName )
return 0;
}
void UpdateStatsFile( float dataTime, char *pMapname, float health, float ammo, int skillLevel )
void UpdateStatsFile( float dataTime, const char *pMapname, float health, float ammo, int skillLevel )
{
FILE *fp;
@ -136,7 +136,7 @@ void UpdateStats( CBasePlayer *pPlayer ) @@ -136,7 +136,7 @@ void UpdateStats( CBasePlayer *pPlayer )
}
else if( ( gStats.nextOutputTime != 0 && gStats.nextOutputTime < gStats.gameTime ) || forceWrite )
{
UpdateStatsFile( gStats.dataTime, (char *)STRING( gpGlobals->mapname ), health, ammo, (int)CVAR_GET_FLOAT( "skill" ) );
UpdateStatsFile( gStats.dataTime, STRING( gpGlobals->mapname ), health, ammo, (int)CVAR_GET_FLOAT( "skill" ) );
gStats.lastAmmo = ammo;
gStats.lastHealth = health;

8
dlls/triggers.cpp

@ -527,7 +527,7 @@ void CBaseTrigger::InitTrigger() @@ -527,7 +527,7 @@ void CBaseTrigger::InitTrigger()
SetMovedir( pev );
pev->solid = SOLID_TRIGGER;
pev->movetype = MOVETYPE_NONE;
SET_MODEL(ENT(pev), STRING( pev->model ) ); // set size and link into world
SET_MODEL( ENT( pev ), STRING( pev->model ) ); // set size and link into world
if( CVAR_GET_FLOAT( "showtriggers" ) == 0 )
SetBits( pev->effects, EF_NODRAW );
}
@ -1135,7 +1135,7 @@ void CBaseTrigger::ActivateMultiTrigger( CBaseEntity *pActivator ) @@ -1135,7 +1135,7 @@ void CBaseTrigger::ActivateMultiTrigger( CBaseEntity *pActivator )
}
if( !FStringNull( pev->noise ) )
EMIT_SOUND( ENT( pev ), CHAN_VOICE, (char*)STRING( pev->noise ), 1, ATTN_NORM );
EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1, ATTN_NORM );
// don't trigger again until reset
// pev->takedamage = DAMAGE_NO;
@ -1264,7 +1264,7 @@ void CTriggerVolume::Spawn( void ) @@ -1264,7 +1264,7 @@ void CTriggerVolume::Spawn( void )
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
SET_MODEL( ENT(pev), STRING( pev->model ) ); // set size and link into world
SET_MODEL( ENT( pev ), STRING( pev->model ) ); // set size and link into world
pev->model = 0;
pev->modelindex = 0;
}
@ -1338,7 +1338,7 @@ TYPEDESCRIPTION CChangeLevel::m_SaveData[] = @@ -1338,7 +1338,7 @@ TYPEDESCRIPTION CChangeLevel::m_SaveData[] =
DEFINE_FIELD( CChangeLevel, m_changeTargetDelay, FIELD_FLOAT ),
};
IMPLEMENT_SAVERESTORE(CChangeLevel,CBaseTrigger)
IMPLEMENT_SAVERESTORE( CChangeLevel, CBaseTrigger )
//
// Cache user-entity-field values until spawn is called.

10
dlls/util.cpp

@ -1052,7 +1052,7 @@ Vector UTIL_GetAimVector( edict_t *pent, float flSpeed ) @@ -1052,7 +1052,7 @@ Vector UTIL_GetAimVector( edict_t *pent, float flSpeed )
return tmp;
}
int UTIL_IsMasterTriggered(string_t sMaster, CBaseEntity *pActivator)
int UTIL_IsMasterTriggered( string_t sMaster, CBaseEntity *pActivator )
{
if( sMaster )
{
@ -1340,7 +1340,7 @@ void UTIL_StringToVector( float *pVector, const char *pString ) @@ -1340,7 +1340,7 @@ void UTIL_StringToVector( float *pVector, const char *pString )
while( *pstr && *pstr != ' ' )
pstr++;
if( !(*pstr) )
if( !( *pstr ) )
break;
pstr++;
pfront = pstr;
@ -1858,7 +1858,7 @@ void CSave::WriteString( const char *pname, const int *stringId, int count ) @@ -1858,7 +1858,7 @@ void CSave::WriteString( const char *pname, const int *stringId, int count )
#if 0
if( count != 1 )
ALERT( at_error, "No string arrays!\n" );
WriteString( pname, (char *)STRING( *stringId ) );
WriteString( pname, STRING( *stringId ) );
#endif
size = 0;
for( i = 0; i < count; i++ )
@ -2209,9 +2209,9 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou @@ -2209,9 +2209,9 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou
if( !FStringNull( string ) && m_precache )
{
if( pTest->fieldType == FIELD_MODELNAME )
PRECACHE_MODEL( (char *)STRING( string ) );
PRECACHE_MODEL( STRING( string ) );
else if( pTest->fieldType == FIELD_SOUNDNAME )
PRECACHE_SOUND( (char *)STRING( string ) );
PRECACHE_SOUND( STRING( string ) );
}
}
break;

2
dlls/util.h

@ -542,7 +542,7 @@ void EMIT_GROUPID_SUIT(edict_t *entity, int isentenceg); @@ -542,7 +542,7 @@ void EMIT_GROUPID_SUIT(edict_t *entity, int isentenceg);
void EMIT_GROUPNAME_SUIT(edict_t *entity, const char *groupname);
#define PRECACHE_SOUND_ARRAY( a ) \
{ for (int i = 0; i < (int)ARRAYSIZE( a ); i++ ) PRECACHE_SOUND((char *) a [i]); }
{ for (int i = 0; i < (int)ARRAYSIZE( a ); i++ ) PRECACHE_SOUND( a[i] ); }
#define EMIT_SOUND_ARRAY_DYN( chan, array ) \
EMIT_SOUND_DYN ( ENT(pev), chan , array [ RANDOM_LONG(0,ARRAYSIZE( array )-1) ], 1.0, ATTN_NORM, 0, RANDOM_LONG(95,105) );

8
dlls/weapons.cpp

@ -367,7 +367,7 @@ void W_Precache( void ) @@ -367,7 +367,7 @@ void W_Precache( void )
g_sModelIndexBloodSpray = PRECACHE_MODEL( "sprites/bloodspray.spr" ); // initial blood
g_sModelIndexBloodDrop = PRECACHE_MODEL( "sprites/blood.spr" ); // splattered blood
g_sModelIndexLaser = PRECACHE_MODEL( (char *)g_pModelNameLaser );
g_sModelIndexLaser = PRECACHE_MODEL( g_pModelNameLaser );
g_sModelIndexLaserDot = PRECACHE_MODEL( "sprites/laserdot.spr" );
// used by explosions
@ -535,7 +535,7 @@ CBaseEntity* CBasePlayerItem::Respawn( void ) @@ -535,7 +535,7 @@ CBaseEntity* CBasePlayerItem::Respawn( void )
{
// make a copy of this weapon that is invisible and inaccessible to players (no touch function). The weapon spawn/respawn code
// will decide when to make the weapon visible and touchable.
CBaseEntity *pNewWeapon = CBaseEntity::Create( (char *)STRING( pev->classname ), g_pGameRules->VecWeaponRespawnSpot( this ), pev->angles, pev->owner );
CBaseEntity *pNewWeapon = CBaseEntity::Create( STRING( pev->classname ), g_pGameRules->VecWeaponRespawnSpot( this ), pev->angles, pev->owner );
if( pNewWeapon )
{
@ -1297,7 +1297,7 @@ void CWeaponBox::Touch( CBaseEntity *pOther ) @@ -1297,7 +1297,7 @@ void CWeaponBox::Touch( CBaseEntity *pOther )
if( !FStringNull( m_rgiszAmmo[i] ) )
{
// there's some ammo of this type.
pPlayer->GiveAmmo( m_rgAmmo[i], (char *)STRING( m_rgiszAmmo[i] ), MaxAmmoCarry( m_rgiszAmmo[i] ) );
pPlayer->GiveAmmo( m_rgAmmo[i], STRING( m_rgiszAmmo[i] ), MaxAmmoCarry( m_rgiszAmmo[i] ) );
//ALERT( at_console, "Gave %d rounds of %s\n", m_rgAmmo[i], STRING( m_rgiszAmmo[i] ) );
@ -1407,7 +1407,7 @@ BOOL CWeaponBox::PackAmmo( int iszName, int iCount ) @@ -1407,7 +1407,7 @@ BOOL CWeaponBox::PackAmmo( int iszName, int iCount )
if( iMaxCarry != -1 && iCount > 0 )
{
//ALERT( at_console, "Packed %d rounds of %s\n", iCount, STRING( iszName ) );
GiveAmmo( iCount, (char *)STRING( iszName ), iMaxCarry );
GiveAmmo( iCount, STRING( iszName ), iMaxCarry );
return TRUE;
}

4
dlls/world.cpp

@ -592,7 +592,7 @@ void CWorld::Precache( void ) @@ -592,7 +592,7 @@ void CWorld::Precache( void )
WorldGraph.InitGraph();
// make sure the .NOD file is newer than the .BSP file.
if( !WorldGraph.CheckNODFile( ( char * )STRING( gpGlobals->mapname ) ) )
if( !WorldGraph.CheckNODFile( STRING( gpGlobals->mapname ) ) )
{
// NOD file is not present, or is older than the BSP file.
WorldGraph.AllocNodes();
@ -600,7 +600,7 @@ void CWorld::Precache( void ) @@ -600,7 +600,7 @@ void CWorld::Precache( void )
else
{
// Load the node graph for this level
if( !WorldGraph.FLoadGraph ( (char *)STRING( gpGlobals->mapname ) ) )
if( !WorldGraph.FLoadGraph( STRING( gpGlobals->mapname ) ) )
{
// couldn't load, so alloc and prepare to build a graph.
ALERT( at_console, "*Error opening .NOD file\n" );

6
dlls/xen.cpp

@ -444,9 +444,9 @@ CXenHull *CXenHull::CreateHull( CBaseEntity *source, const Vector &mins, const V @@ -444,9 +444,9 @@ CXenHull *CXenHull::CreateHull( CBaseEntity *source, const Vector &mins, const V
CXenHull *pHull = GetClassPtr( (CXenHull *)NULL );
UTIL_SetOrigin( pHull->pev, source->pev->origin + offset );
SET_MODEL( pHull->edict(), STRING(source->pev->model) );
SET_MODEL( pHull->edict(), STRING( source->pev->model ) );
pHull->pev->solid = SOLID_BBOX;
pHull->pev->classname = MAKE_STRING("xen_hull");
pHull->pev->classname = MAKE_STRING( "xen_hull" );
pHull->pev->movetype = MOVETYPE_NONE;
pHull->pev->owner = source->edict();
UTIL_SetSize( pHull->pev, mins, maxs );
@ -527,7 +527,7 @@ const char *CXenSpore::pModelNames[] = @@ -527,7 +527,7 @@ const char *CXenSpore::pModelNames[] =
void CXenSpore::Precache( void )
{
PRECACHE_MODEL( (char *)pModelNames[pev->skin] );
PRECACHE_MODEL( pModelNames[pev->skin] );
}
void CXenSpore::Touch( CBaseEntity *pOther )

14
dlls/zombie.cpp

@ -266,7 +266,7 @@ void CZombie::Spawn() @@ -266,7 +266,7 @@ void CZombie::Spawn()
{
Precache();
SET_MODEL( ENT(pev), "models/zombie.mdl" );
SET_MODEL( ENT( pev ), "models/zombie.mdl" );
UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX );
pev->solid = SOLID_SLIDEBOX;
@ -291,22 +291,22 @@ void CZombie::Precache() @@ -291,22 +291,22 @@ void CZombie::Precache()
PRECACHE_MODEL( "models/zombie.mdl" );
for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackHitSounds[i] );
PRECACHE_SOUND( pAttackHitSounds[i] );
for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackMissSounds[i] );
PRECACHE_SOUND( pAttackMissSounds[i] );
for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ )
PRECACHE_SOUND( (char *)pAttackSounds[i] );
PRECACHE_SOUND( pAttackSounds[i] );
for( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ )
PRECACHE_SOUND( (char *)pIdleSounds[i] );
PRECACHE_SOUND( pIdleSounds[i] );
for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ )
PRECACHE_SOUND( (char *)pAlertSounds[i] );
PRECACHE_SOUND( pAlertSounds[i] );
for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ )
PRECACHE_SOUND( (char *)pPainSounds[i] );
PRECACHE_SOUND( pPainSounds[i] );
}
//=========================================================

Loading…
Cancel
Save