Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sp/src/game/server/hl2/npc_combinedropship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ class CNPC_CombineDropship : public CBaseHelicopter
bool m_bWaitForDropoffInput;
#ifdef MAPBASE
bool m_bDontEmitDanger;
bool m_bUseAvoidEnts;
#endif

DECLARE_DATADESC();
Expand Down Expand Up @@ -827,6 +828,7 @@ BEGIN_DATADESC( CNPC_CombineDropship )
DEFINE_FIELD( m_bWaitForDropoffInput, FIELD_BOOLEAN ),
#ifdef MAPBASE
DEFINE_KEYFIELD( m_bDontEmitDanger, FIELD_BOOLEAN, "DontEmitDanger" ),
DEFINE_KEYFIELD( m_bUseAvoidEnts, FIELD_BOOLEAN, "UseAvoidEnts" ),
#endif
DEFINE_FIELD( m_hLandTarget, FIELD_EHANDLE ),
DEFINE_FIELD( m_bHasDroppedOff, FIELD_BOOLEAN ),
Expand Down Expand Up @@ -1380,6 +1382,18 @@ void CNPC_CombineDropship::Flight( void )
}
}

#ifdef MAPBASE
// Apply avoidance forces
if ( m_bUseAvoidEnts )
{
Vector vecAvoidForce;
CAvoidSphere::ComputeAvoidanceForces( this, 350.0f, 2.0f, &vecAvoidForce );
accel += vecAvoidForce;
CAvoidBox::ComputeAvoidanceForces( this, 350.0f, 2.0f, &vecAvoidForce );
accel += vecAvoidForce;
}
#endif

// don't fall faster than 0.2G or climb faster than 2G
accel.z = clamp( accel.z, 384 * 0.2, 384 * 2.0 );

Expand Down
Loading