Browse Source

Fix some potential troubles.

Comment some useless code.
half-secret
Andrey Akhmichin 5 years ago
parent
commit
b8825c2039
  1. 4
      cl_dll/MOTD.cpp
  2. 4
      cl_dll/StudioModelRenderer.cpp
  3. 2
      cl_dll/cdll_int.cpp
  4. 4
      cl_dll/demo.cpp
  5. 2
      cl_dll/geiger.cpp
  6. 5
      cl_dll/health.cpp
  7. 2
      cl_dll/hl/hl_weapons.cpp
  8. 2
      cl_dll/message.cpp
  9. 2
      cl_dll/saytext.cpp
  10. 2
      cl_dll/view.cpp
  11. 4
      dlls/apache.cpp
  12. 4
      dlls/combat.cpp
  13. 4
      dlls/func_break.cpp
  14. 2
      dlls/hgrunt.cpp
  15. 4
      dlls/hornet.cpp
  16. 5
      dlls/islave.cpp
  17. 10
      dlls/monsters.cpp
  18. 4
      dlls/nihilanth.cpp
  19. 4
      dlls/nodes.cpp
  20. 7
      dlls/osprey.cpp
  21. 2
      dlls/plats.cpp
  22. 4
      dlls/sound.cpp
  23. 4
      dlls/squeakgrenade.cpp
  24. 3
      dlls/talkmonster.cpp
  25. 6
      pm_shared/pm_debug.c

4
cl_dll/MOTD.cpp

@ -86,7 +86,7 @@ int CHudMOTD::Draw( float fTime ) @@ -86,7 +86,7 @@ int CHudMOTD::Draw( float fTime )
ypos_r = ROW_RANGE_MIN;
height = ROW_RANGE_MAX;
}
int ymax = ypos + height;
// int ymax = ypos + height;
if( xmax > ScreenWidth - 30 ) xmax = ScreenWidth - 30;
gHUD.DrawDarkRectangle( xpos - 5, ypos_r - 5, xmax - xpos + 10, height + 10 );
while( *ch )
@ -157,7 +157,7 @@ int CHudMOTD::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ) @@ -157,7 +157,7 @@ int CHudMOTD::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf )
if( length > m_iMaxLength )
{
m_iMaxLength = length;
length = 0;
// length = 0;
}
m_bShow = true;
}

4
cl_dll/StudioModelRenderer.cpp

@ -684,9 +684,9 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[ @@ -684,9 +684,9 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[
else if( gEngfuncs.pfnRandomLong( 0, 49 ) == 0 )
{
float offset;
int axis = gEngfuncs.pfnRandomLong(0,1);
/*int axis = gEngfuncs.pfnRandomLong(0,1);
if( axis == 1 ) // Choose between x & z
axis = 2;
axis = 2;*/
offset = gEngfuncs.pfnRandomFloat( -10.0f, 10.0f );
transform[gEngfuncs.pfnRandomLong( 0, 2 )][3] += offset;
}

2
cl_dll/cdll_int.cpp

@ -124,7 +124,7 @@ HUD_ConnectionlessPacket @@ -124,7 +124,7 @@ HUD_ConnectionlessPacket
int DLLEXPORT HUD_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size )
{
// Parse stuff from args
int max_buffer_size = *response_buffer_size;
// int max_buffer_size = *response_buffer_size;
// Zero it out since we aren't going to respond.
// If we wanted to response, we'd write data into response_buffer

4
cl_dll/demo.cpp

@ -88,12 +88,12 @@ void DLLEXPORT Demo_ReadBuffer( int size, unsigned char *buffer ) @@ -88,12 +88,12 @@ void DLLEXPORT Demo_ReadBuffer( int size, unsigned char *buffer )
g_demosniperorg[1] = *(float *)&buffer[i];
i += sizeof(float);
g_demosniperorg[2] = *(float *)&buffer[i];
i += sizeof(float);
// i += sizeof(float);
}
break;
case TYPE_ZOOM:
g_demozoom = *(float *)&buffer[i];
i += sizeof(float);
// i += sizeof(float);
break;
default:
gEngfuncs.Con_DPrintf( "Unknown demo buffer type, skipping.\n" );

2
cl_dll/geiger.cpp

@ -66,7 +66,7 @@ int CHudGeiger::Draw( float flTime ) @@ -66,7 +66,7 @@ int CHudGeiger::Draw( float flTime )
int pct;
float flvol = 0.0f;
//int rg[3];
int i;
int i = 0;
if( m_iGeigerRange < 1000 && m_iGeigerRange > 0 )
{

5
cl_dll/health.cpp

@ -152,13 +152,14 @@ int CHudHealth::MsgFunc_Damage( const char *pszName, int iSize, void *pbuf ) @@ -152,13 +152,14 @@ int CHudHealth::MsgFunc_Damage( const char *pszName, int iSize, void *pbuf )
// Green <-> Yellow <-> Red ramp
void CHudHealth::GetPainColor( int &r, int &g, int &b )
{
#if 0
int iHealth = m_iHealth;
if( iHealth > 25 )
iHealth -= 25;
else if( iHealth < 0 )
iHealth = 0;
#if 0
g = iHealth * 255 / 100;
r = 255 - g;
b = 0;
@ -461,7 +462,7 @@ void CHudHealth::UpdateTiles( float flTime, long bitsDamage ) @@ -461,7 +462,7 @@ void CHudHealth::UpdateTiles( float flTime, long bitsDamage )
if( pdmg->y )
pdmg->y -= giDmgHeight;
}
pdmg = &m_dmg[i];
// pdmg = &m_dmg[i];
}
}

2
cl_dll/hl/hl_weapons.cpp

@ -307,7 +307,7 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD @@ -307,7 +307,7 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD
// get circular gaussian spread
x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5f, 0.5f );
y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5f, 0.5f );
z = x * x + y * y;
// z = x * x + y * y;
}
}

2
cl_dll/message.cpp

@ -352,7 +352,7 @@ int CHudMessage::Draw( float fTime ) @@ -352,7 +352,7 @@ int CHudMessage::Draw( float fTime )
// Assume m_parms.time contains last time
if( m_pMessages[i] )
{
pMessage = m_pMessages[i];
// pMessage = m_pMessages[i];
if( m_startTime[i] > gHUD.m_flTime )
m_startTime[i] = gHUD.m_flTime + m_parms.time - m_startTime[i] + 0.2f; // Server takes 0.2 seconds to spawn, adjust for this
}

2
cl_dll/saytext.cpp

@ -259,7 +259,7 @@ void CHudSayText::EnsureTextFitsInOneLineAndWrapIfHaveTo( int line ) @@ -259,7 +259,7 @@ void CHudSayText::EnsureTextFitsInOneLineAndWrapIfHaveTo( int line )
if( !last_break )
last_break = x - 1;
x = last_break;
// x = last_break;
// find an empty string slot
int j;

2
cl_dll/view.cpp

@ -491,7 +491,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) @@ -491,7 +491,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams )
}
else
{
waterEntity = 0; // Don't need this in software
// waterEntity = 0; // Don't need this in software
}
VectorCopy( pparams->vieworg, point );

4
dlls/apache.cpp

@ -717,9 +717,9 @@ void CApache::Flight( void ) @@ -717,9 +717,9 @@ void CApache::Flight( void )
if( pitch == 100.0f )
pitch = 101.0f;
float flVol = ( m_flForce / 100.0f ) + 0.1f;
/*float flVol = ( m_flForce / 100.0f ) + 0.1f;
if( flVol > 1.0f )
flVol = 1.0f;
flVol = 1.0f;*/
EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0f, 0.3f, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch );
}

4
dlls/combat.cpp

@ -459,10 +459,10 @@ Activity CBaseMonster::GetDeathActivity( void ) @@ -459,10 +459,10 @@ Activity CBaseMonster::GetDeathActivity( void )
Activity CBaseMonster::GetSmallFlinchActivity( void )
{
Activity flinchActivity;
BOOL fTriedDirection;
// BOOL fTriedDirection;
//float flDot;
fTriedDirection = FALSE;
// fTriedDirection = FALSE;
UTIL_MakeVectors( pev->angles );
//flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1.0f );

4
dlls/func_break.cpp

@ -710,11 +710,11 @@ void CBreakable::Die( void ) @@ -710,11 +710,11 @@ void CBreakable::Die( void )
WRITE_BYTE( cFlag );
MESSAGE_END();
float size = pev->size.x;
/*float size = pev->size.x;
if( size < pev->size.y )
size = pev->size.y;
if( size < pev->size.z )
size = pev->size.z;
size = pev->size.z;*/
// !!! HACK This should work!
// Build a box above the entity that looks like an 8 pixel high sheet

2
dlls/hgrunt.cpp

@ -423,7 +423,6 @@ BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist ) @@ -423,7 +423,6 @@ BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist )
{
return FALSE;
}
}
if( flDist <= 64.0f && flDot >= 0.7f &&
pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON &&
@ -431,6 +430,7 @@ BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist ) @@ -431,6 +430,7 @@ BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist )
{
return TRUE;
}
}
return FALSE;
}

4
dlls/hornet.cpp

@ -95,9 +95,9 @@ void CHornet::Spawn( void ) @@ -95,9 +95,9 @@ void CHornet::Spawn( void )
SetTouch( &CHornet::DieTouch );
SetThink( &CHornet::StartTrack );
edict_t *pSoundEnt = pev->owner;
/*edict_t *pSoundEnt = pev->owner;
if( !pSoundEnt )
pSoundEnt = edict();
pSoundEnt = edict();*/
if( !FNullEnt( pev->owner ) && ( pev->owner->v.flags & FL_CLIENT ) )
{

5
dlls/islave.cpp

@ -639,11 +639,14 @@ Schedule_t *CISlave::GetSchedule( void ) @@ -639,11 +639,14 @@ Schedule_t *CISlave::GetSchedule( void )
ASSERT( pSound != NULL );
if( pSound && ( pSound->m_iType & bits_SOUND_DANGER ) )
if( pSound )
{
if( pSound->m_iType & bits_SOUND_DANGER )
return GetScheduleOfType( SCHED_TAKE_COVER_FROM_BEST_SOUND );
if( pSound->m_iType & bits_SOUND_COMBAT )
m_afMemory |= bits_MEMORY_PROVOKED;
}
}
switch( m_MonsterState )
{

10
dlls/monsters.cpp

@ -262,6 +262,7 @@ void CBaseMonster::Listen( void ) @@ -262,6 +262,7 @@ void CBaseMonster::Listen( void )
}
//iSound = g_pSoundEnt->m_SoundPool[iSound].m_iNext;
if( pCurrentSound )
iSound = pCurrentSound->m_iNext;
}
}
@ -431,7 +432,9 @@ CSound *CBaseMonster::PBestSound( void ) @@ -431,7 +432,9 @@ CSound *CBaseMonster::PBestSound( void )
{
pSound = CSoundEnt::SoundPointerForIndex( iThisSound );
if( pSound && pSound->FIsSound() )
if( pSound )
{
if( pSound->FIsSound() )
{
flDist = ( pSound->m_vecOrigin - EarPosition() ).Length();
@ -444,6 +447,7 @@ CSound *CBaseMonster::PBestSound( void ) @@ -444,6 +447,7 @@ CSound *CBaseMonster::PBestSound( void )
iThisSound = pSound->m_iNextAudible;
}
}
if( iBestSound >= 0 )
{
pSound = CSoundEnt::SoundPointerForIndex( iBestSound );
@ -2367,7 +2371,7 @@ BOOL CBaseMonster::BuildNearestRoute( Vector vecThreat, Vector vecViewOffset, fl @@ -2367,7 +2371,7 @@ BOOL CBaseMonster::BuildNearestRoute( Vector vecThreat, Vector vecViewOffset, fl
// try to actually get there
if( BuildRoute( node.m_vecOrigin, bits_MF_TO_LOCATION, NULL ) )
{
flMaxDist = flDist;
// flMaxDist = flDist;
m_vecMoveGoal = node.m_vecOrigin;
return TRUE; // UNDONE: keep looking for something closer!
}
@ -3278,7 +3282,7 @@ BOOL CBaseMonster::BBoxFlat( void ) @@ -3278,7 +3282,7 @@ BOOL CBaseMonster::BBoxFlat( void )
{
return FALSE;
}
flLength = flLength2;
// flLength = flLength2;
return TRUE;
}

4
dlls/nihilanth.cpp

@ -944,10 +944,10 @@ void CNihilanth::Flight( void ) @@ -944,10 +944,10 @@ void CNihilanth::Flight( void )
m_velocity.y += gpGlobals->v_up.y * m_flForce;
m_velocity.z += gpGlobals->v_up.z * m_flForce;
float flSpeed = m_velocity.Length();
/*float flSpeed = m_velocity.Length();
float flDir = DotProduct( Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, 0 ), Vector( m_velocity.x, m_velocity.y, 0 ) );
if( flDir < 0 )
flSpeed = -flSpeed;
flSpeed = -flSpeed;*/
//float flDist = DotProduct( m_posDesired - vecEst, gpGlobals->v_forward );

4
dlls/nodes.cpp

@ -2533,7 +2533,7 @@ int CGraph::FLoadGraph( const char *szMapName ) @@ -2533,7 +2533,7 @@ int CGraph::FLoadGraph( const char *szMapName )
if( length < 0 )
goto ShortFile;
memcpy( m_pHashLinks, pMemFile, sizeof(short) * m_nHashLinks );
pMemFile += sizeof(short) * m_nHashLinks;
// pMemFile += sizeof(short) * m_nHashLinks;
// Set the graph present flag, clear the pointers set flag
//
@ -3641,7 +3641,7 @@ void CNodeViewer::Spawn() @@ -3641,7 +3641,7 @@ void CNodeViewer::Spawn()
int start = 0;
int end;
do{
end = m_nVisited;
// end = m_nVisited;
// ALERT( at_console, "%d :", m_nVisited );
for( end = m_nVisited; start < end; start++ )
{

7
dlls/osprey.cpp

@ -383,14 +383,19 @@ void COsprey::FlyThink( void ) @@ -383,14 +383,19 @@ void COsprey::FlyThink( void )
}
if( gpGlobals->time > m_startTime + m_dTime )
{
if( m_pGoalEnt )
{
if( m_pGoalEnt->pev->speed == 0 )
{
SetThink( &COsprey::DeployThink );
}
do{
m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_pGoalEnt->pev->target ) ) );
} while( m_pGoalEnt->pev->speed < 400 && !HasDead() );
} while( m_pGoalEnt && m_pGoalEnt->pev->speed < 400 && !HasDead() );
}
UpdateGoal();
}

2
dlls/plats.cpp

@ -1750,7 +1750,7 @@ void CFuncTrackChange::Find( void ) @@ -1750,7 +1750,7 @@ void CFuncTrackChange::Find( void )
else
{
ALERT( at_error, "Can't find train for track change! %s\n", STRING( m_trainName ) );
target = FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_trainName ) );
// target = FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_trainName ) );
}
}
else

4
dlls/sound.cpp

@ -280,7 +280,7 @@ void CAmbientGeneric::RampThink( void ) @@ -280,7 +280,7 @@ void CAmbientGeneric::RampThink( void )
if( pitch < m_dpv.pitchstart )
{
pitch = m_dpv.pitchstart;
// pitch = m_dpv.pitchstart;
m_dpv.spindown = 0; // done with ramp down
// shut sound off
@ -324,7 +324,7 @@ void CAmbientGeneric::RampThink( void ) @@ -324,7 +324,7 @@ void CAmbientGeneric::RampThink( void )
if( vol < m_dpv.volstart )
{
vol = m_dpv.volstart;
// vol = m_dpv.volstart;
m_dpv.fadeout = 0; // done with ramp down
// shut sound off

4
dlls/squeakgrenade.cpp

@ -266,9 +266,9 @@ void CSqueakGrenade::HuntThink( void ) @@ -266,9 +266,9 @@ void CSqueakGrenade::HuntThink( void )
}
// higher pitch as squeeker gets closer to detonation time
float flpitch = 155.0f - 60.0f * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY );
/*float flpitch = 155.0f - 60.0f * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY );
if( flpitch < 80.0f )
flpitch = 80.0f;
flpitch = 80.0f;*/
if( m_hEnemy != 0 )
{

3
dlls/talkmonster.cpp

@ -493,6 +493,8 @@ void CTalkMonster::RunTask( Task_t *pTask ) @@ -493,6 +493,8 @@ void CTalkMonster::RunTask( Task_t *pTask )
}
if( pTask->iTask == TASK_TLK_CLIENT_STARE )
{
if( pPlayer )
{
// fail out if the player looks away or moves away.
if( ( pPlayer->v.origin - pev->origin ).Length2D() > TLK_STARE_DIST )
@ -508,6 +510,7 @@ void CTalkMonster::RunTask( Task_t *pTask ) @@ -508,6 +510,7 @@ void CTalkMonster::RunTask( Task_t *pTask )
TaskFail();
}
}
}
if( gpGlobals->time > m_flWaitFinished )
{

6
pm_shared/pm_debug.c

@ -289,7 +289,7 @@ void PM_ViewEntity( void ) @@ -289,7 +289,7 @@ void PM_ViewEntity( void )
int i;
pmtrace_t trace;
int pcolor = 77;
float fup;
// float fup;
#if 0
if ( !pm_showclip.value )
@ -300,9 +300,9 @@ void PM_ViewEntity( void ) @@ -300,9 +300,9 @@ void PM_ViewEntity( void )
VectorCopy( pmove->origin, origin);
fup = 0.5f * ( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] );
/*fup = 0.5f * ( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] );
fup += pmove->view_ofs[2];
fup -= 4;
fup -= 4;*/
for (i = 0; i < 3; i++)
{

Loading…
Cancel
Save