Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 39 deletions.
2 changes: 1 addition & 1 deletion sp/src/game/client/physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void PhysicsLevelInit( void )
physenv->SetGravity( Vector(0, 0, -GetCurrentGravity() ) );
// 15 ms per tick
// NOTE: Always run client physics at this rate - helps keep ragdolls stable
physenv->SetSimulationTimestep( IsXbox() ? DEFAULT_XBOX_CLIENT_VPHYSICS_TICK : DEFAULT_TICK_INTERVAL );
physenv->SetSimulationTimestep(IsXbox() ? DEFAULT_XBOX_CLIENT_VPHYSICS_TICK : gpGlobals->interval_per_tick);
physenv->SetCollisionEventHandler( &g_Collisions );
physenv->SetCollisionSolver( &g_Collisions );

Expand Down
4 changes: 2 additions & 2 deletions sp/src/game/client/prediction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,10 @@ void CPrediction::RunCommand( C_BasePlayer *player, CUserCmd *ucmd, IMoveHelper
pVehicle->ProcessMovement( player, g_pMoveData );
}

FinishMove( player, ucmd, g_pMoveData );

RunPostThink( player );

FinishMove(player, ucmd, g_pMoveData);

g_pGameMovement->FinishTrackPredictionErrors( player );

FinishCommand( player );
Expand Down
10 changes: 8 additions & 2 deletions sp/src/game/server/ai_basenpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3252,7 +3252,10 @@ void CAI_BaseNPC::UpdateEfficiency( bool bInPVS )
}
}

iSound = pCurrentSound->NextSound();
if (pCurrentSound)
iSound = pCurrentSound->NextSound();
else
break;
}
}

Expand Down Expand Up @@ -3439,7 +3442,10 @@ void CAI_BaseNPC::UpdateSleepState( bool bInPVS )
break;
}

iSound = pCurrentSound->NextSound();
if (pCurrentSound)
iSound = pCurrentSound->NextSound();
else
break;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sp/src/game/server/ai_behavior_assault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ int CAI_AssaultBehavior::TranslateSchedule( int scheduleType )
break;

case SCHED_HOLD_RALLY_POINT:
if( HasCondition(COND_NO_PRIMARY_AMMO) | HasCondition(COND_LOW_PRIMARY_AMMO) )
if( HasCondition(COND_NO_PRIMARY_AMMO) || HasCondition(COND_LOW_PRIMARY_AMMO) )
{
return SCHED_RELOAD;
}
Expand Down
5 changes: 4 additions & 1 deletion sp/src/game/server/ai_senses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ void CAI_Senses::Listen( void )
m_iAudibleList = iSound;
}

iSound = pCurrentSound->NextSound();
if (pCurrentSound)
iSound = pCurrentSound->NextSound();
else
break;
}
}

Expand Down
4 changes: 2 additions & 2 deletions sp/src/game/server/baseentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2989,9 +2989,9 @@ FORCEINLINE bool NamesMatch( const char *pszQuery, string_t nameToMatch )
// simple ascii case conversion
if ( cName == cQuery )
;
else if ( cName - 'A' <= (unsigned char)'Z' - 'A' && cName - 'A' + 'a' == cQuery )
else if ((unsigned char)(cName - 'A') <= (unsigned char)('Z' - 'A') && (unsigned char)(cName - 'A' + 'a') == cQuery)
;
else if ( cName - 'a' <= (unsigned char)'z' - 'a' && cName - 'a' + 'A' == cQuery )
else if ((unsigned char)(cName - 'a') <= (unsigned char)('z' - 'a') && (unsigned char)(cName - 'a' + 'A') == cQuery)
;
else
break;
Expand Down
6 changes: 4 additions & 2 deletions sp/src/game/server/envmicrophone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,11 @@ void CEnvMicrophone::Think(void)
fHearSound = true;
}
}
}

nSound = pCurrentSound->NextSound();
nSound = pCurrentSound->NextSound();
}
else
break;
}

if( fHearSound )
Expand Down
6 changes: 3 additions & 3 deletions sp/src/game/server/firefightreloaded/weapon_slam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ bool CWeapon_SLAM::AnyUndetonatedCharges(void)
void CWeapon_SLAM::StartSatchelDetonate()
{

if ( GetActivity() != ACT_SLAM_DETONATOR_IDLE && GetActivity() != ACT_SLAM_THROW_IDLE )
return;
if (GetActivity() != ACT_SLAM_DETONATOR_IDLE && GetActivity() != ACT_SLAM_THROW_IDLE && !m_bDetonatorArmed) //fix for being unable to detonate when holding a detonator and ready tripmine in hand
return;

// -----------------------------------------
// Play detonate animation
Expand All @@ -256,7 +256,7 @@ void CWeapon_SLAM::StartSatchelDetonate()
{
SendWeaponAnim(ACT_SLAM_DETONATOR_DETONATE);
}
else if (m_tSlamState == SLAM_SATCHEL_ATTACH)
else if (m_tSlamState == SLAM_SATCHEL_ATTACH || m_tSlamState == SLAM_TRIPMINE_READY) // second part of the aforementioned fix
{
SendWeaponAnim(ACT_SLAM_STICKWALL_DETONATE);
}
Expand Down
5 changes: 4 additions & 1 deletion sp/src/game/server/hl2/npc_manhack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3015,7 +3015,10 @@ void CNPC_Manhack::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t r
void CNPC_Manhack::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Reason )
{
// Stop suppressing collisions between the manhack and the player
SetOwnerEntity( NULL );
SetOwnerEntity(m_pPrevOwner.Get());

// Reset previous owner back to NULL.
m_pPrevOwner.Set(NULL);

m_bHeld = false;

Expand Down
1 change: 1 addition & 0 deletions sp/src/game/server/hl2/npc_manhack.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ DECLARE_SERVERCLASS();
CSprite *m_pLightGlow;

CHandle<SmokeTrail> m_hSmokeTrail;
CHandle<CBaseEntity> m_pPrevOwner;

int m_iPanel1;
int m_iPanel2;
Expand Down
1 change: 0 additions & 1 deletion sp/src/game/server/hl2/weapon_rpg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,6 @@ void CWeaponRPG::Precache( void )
PrecacheScriptSound( "Missile.Accelerate" );

// Laser dot...
PrecacheModel( "sprites/redglow1.vmt" );
PrecacheModel( RPG_LASER_SPRITE );
PrecacheModel( RPG_BEAM_SPRITE );

Expand Down
6 changes: 3 additions & 3 deletions sp/src/game/server/physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void CPhysicsHook::LevelInitPreEntity()

physenv->SetObjectEventHandler( &g_Collisions );

physenv->SetSimulationTimestep( DEFAULT_TICK_INTERVAL ); // 15 ms per tick
physenv->SetSimulationTimestep(gpGlobals->interval_per_tick); // 15 ms per tick
// HL Game gravity, not real-world gravity
physenv->SetGravity( Vector( 0, 0, -GetCurrentGravity() ) );
g_PhysAverageSimTime = 0;
Expand Down Expand Up @@ -1606,7 +1606,7 @@ CON_COMMAND( physics_budget, "Times the cost of each active object" )
float totalTime = 0.f;
g_Collisions.BufferTouchEvents( true );
float full = engine->Time();
physenv->Simulate( DEFAULT_TICK_INTERVAL );
physenv->Simulate(gpGlobals->interval_per_tick);
full = engine->Time() - full;
float lastTime = full;

Expand All @@ -1623,7 +1623,7 @@ CON_COMMAND( physics_budget, "Times the cost of each active object" )
PhysForceEntityToSleep( ents[j], ents[j]->VPhysicsGetObject() );
}
float start = engine->Time();
physenv->Simulate( DEFAULT_TICK_INTERVAL );
physenv->Simulate(gpGlobals->interval_per_tick);
float end = engine->Time();

float elapsed = end - start;
Expand Down
16 changes: 8 additions & 8 deletions sp/src/game/server/player_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
player->pl.v_angle = ucmd->viewangles + player->pl.anglechange;
}

// Let server invoke any needed impact functions
VPROF_SCOPE_BEGIN("moveHelper->ProcessImpacts");
moveHelper->ProcessImpacts();
VPROF_SCOPE_END();

// Call standard client pre-think
RunPreThink( player );

Expand All @@ -438,17 +443,12 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
VPROF( "pVehicle->ProcessMovement()" );
pVehicle->ProcessMovement( player, g_pMoveData );
}


RunPostThink(player);

// Copy output
FinishMove( player, ucmd, g_pMoveData );

// Let server invoke any needed impact functions
VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" );
moveHelper->ProcessImpacts();
VPROF_SCOPE_END();

RunPostThink( player );

g_pGameMovement->FinishTrackPredictionErrors( player );

FinishCommand( player );
Expand Down
4 changes: 2 additions & 2 deletions sp/src/game/server/soundscape_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void CSoundscapeSystem::AddSoundscapeFile( const char *filename )
MEM_ALLOC_CREDIT();
// Open the soundscape data file, and abort if we can't
KeyValues *pKeyValuesData = new KeyValues( filename );
if ( filesystem->LoadKeyValues( *pKeyValuesData, IFileSystem::TYPE_SOUNDSCAPE, filename, "GAME" ) )
if (pKeyValuesData->LoadFromFile(filesystem, filename, "GAME"))
{
// parse out all of the top level sections and save their names
KeyValues *pKeys = pKeyValuesData;
Expand Down Expand Up @@ -137,7 +137,7 @@ bool CSoundscapeSystem::Init()
}

KeyValues *manifest = new KeyValues( SOUNDSCAPE_MANIFEST_FILE );
if ( filesystem->LoadKeyValues( *manifest, IFileSystem::TYPE_SOUNDSCAPE, SOUNDSCAPE_MANIFEST_FILE, "GAME" ) )
if (manifest->LoadFromFile(filesystem, SOUNDSCAPE_MANIFEST_FILE, "GAME"))
{
for ( KeyValues *sub = manifest->GetFirstSubKey(); sub != NULL; sub = sub->GetNextKey() )
{
Expand Down
2 changes: 1 addition & 1 deletion sp/src/game/shared/baseentity_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ bool CBaseEntity::KeyValue( const char *szKeyName, const char *szValue )
}

// Do this so inherited classes looking for 'angles' don't have to bother with 'angle'
return KeyValue( szKeyName, szBuf );
return KeyValue("angles", szBuf);
}

// NOTE: Have to do these separate because they set two values instead of one
Expand Down
22 changes: 13 additions & 9 deletions sp/src/game/shared/ragdoll_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,15 +871,16 @@ void CRagdollLRURetirement::Update( float frametime ) // EPISODIC VERSION

for ( i = m_LRU.Head(); i < m_LRU.InvalidIndex(); i = next )
{
CBaseAnimating *pRagdoll = m_LRU[i].Get();

next = m_LRU.Next(i);
IPhysicsObject *pObject = pRagdoll->VPhysicsGetObject();
if ( pRagdoll && (pRagdoll->GetEffectEntity() || ( pObject && !pObject->IsAsleep()) ) )
continue;

CBaseAnimating* pRagdoll = m_LRU[i].Get();

if ( pRagdoll )
{
IPhysicsObject* pObject = pRagdoll->VPhysicsGetObject();
if (pRagdoll->GetEffectEntity() || (pObject && !pObject->IsAsleep()))
continue;

// float distToPlayer = (pPlayer->GetAbsOrigin() - pRagdoll->GetAbsOrigin()).LengthSqr();
float distToPlayer = (PlayerOrigin - pRagdoll->GetAbsOrigin()).LengthSqr();

Expand Down Expand Up @@ -914,10 +915,13 @@ void CRagdollLRURetirement::Update( float frametime ) // EPISODIC VERSION

CBaseAnimating *pRagdoll = m_LRU[i].Get();

//Just ignore it until we're done burning/dissolving.
IPhysicsObject *pObject = pRagdoll->VPhysicsGetObject();
if ( pRagdoll && (pRagdoll->GetEffectEntity() || ( pObject && !pObject->IsAsleep()) ) )
continue;
if (pRagdoll)
{
//Just ignore it until we're done burning/dissolving.
IPhysicsObject* pObject = pRagdoll->VPhysicsGetObject();
if (pRagdoll->GetEffectEntity() || (pObject && !pObject->IsAsleep()))
continue;
}

#ifdef CLIENT_DLL
m_LRU[ i ]->SUB_Remove();
Expand Down

0 comments on commit b613544

Please sign in to comment.