mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-10 20:16:30 +00:00
Trains: Exclude vphysics
► Instead of forcefully setting velocity on all entities, ensure that physics objects are moved naturally by physics interactions.
This commit is contained in:
parent
a62efecf62
commit
4df91ab14f
1 changed files with 8 additions and 5 deletions
|
@ -1694,11 +1694,14 @@ void CFuncTrackTrain::Blocked( CBaseEntity *pOther )
|
|||
}
|
||||
else
|
||||
{
|
||||
Vector vecNewVelocity;
|
||||
vecNewVelocity = pOther->GetAbsOrigin() - GetAbsOrigin();
|
||||
VectorNormalize(vecNewVelocity);
|
||||
vecNewVelocity *= m_flBlockDamage;
|
||||
pOther->SetAbsVelocity( vecNewVelocity );
|
||||
if ( pOther->GetMoveType() != MOVETYPE_VPHYSICS )
|
||||
{
|
||||
Vector vecNewVelocity;
|
||||
vecNewVelocity = pOther->GetAbsOrigin() - GetAbsOrigin();
|
||||
VectorNormalize( vecNewVelocity );
|
||||
vecNewVelocity *= m_flBlockDamage;
|
||||
pOther->SetAbsVelocity( vecNewVelocity );
|
||||
}
|
||||
}
|
||||
if ( HasSpawnFlags(SF_TRACKTRAIN_UNBLOCKABLE_BY_PLAYER) )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue