game_shared/physics_main_shared.cpp
171819202122
#include "igamesystem.h"
#include "utlmultilist.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
1718192021222324252627282930
#include "igamesystem.h"
#include "utlmultilist.h"
// BEG: Added by Mulch 11/07/2005
#ifdef CLIENT_DLL
//#define CFFBuildableObject C_FFBuildableObject
#endif
#include "ff_buildableobjects_shared.h"
// END: Added by Mulch 11/07/2005
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
448449450451452453454455456457
//-----------------------------------------------------------------------------
void CBaseEntity::PhysicsCheckForEntityUntouch( void )
{
Assert( g_pNextLink == NULL );
touchlink_t *link;
touchlink_t *root = ( touchlink_t * )GetDataObject( TOUCHLINK );
if ( root )
{
456457458459460461462463
//-----------------------------------------------------------------------------
void CBaseEntity::PhysicsCheckForEntityUntouch( void )
{
touchlink_t *link, *nextLink;
touchlink_t *root = ( touchlink_t * )GetDataObject( TOUCHLINK );
if ( root )
{
461462463464465466467
link = root->nextLink;
while ( link != root )
{
g_pNextLink = link->nextLink;
// these touchlinks are not polled. The ents are touching due to an outside
// system that will add/delete them as necessary (vphysics in this case)
467468469470471472473
link = root->nextLink;
while ( link != root )
{
nextLink = link->nextLink;
// these touchlinks are not polled. The ents are touching due to an outside
// system that will add/delete them as necessary (vphysics in this case)
484485486487488489490
}
}
link = g_pNextLink;
}
g_bCleanupDatObject = saveCleanup;
490491492493494495496
}
}
link = nextLink;
}
g_bCleanupDatObject = saveCleanup;
491492493494495496497498499500501502503504
// Nothing left in list, destroy root
if ( root->nextLink == root &&
root->prevLink == root )
{
DestroyDataObject( TOUCHLINK );
}
}
g_pNextLink = NULL;
SetCheckUntouch( false );
}
497498499500501502503504505506507508
// Nothing left in list, destroy root
if ( root->nextLink == root &&
root->prevLink == root )
{
DestroyDataObject( TOUCHLINK );
}
}
SetCheckUntouch( false );
}
923924925926927928
return;
}
// If either of the entities is flagged to be deleted,
// don't call the touch functions
if ( ( GetFlags() | other->GetFlags() ) & FL_KILLME )
927928929930931932933934935936937938939940941942943944945946
return;
}
// BEG: Added by Mulch 11/07/2005
if( trace.m_pEnt )
{
if( ( trace.m_pEnt->Classify() == CLASS_DISPENSER ) ||
( trace.m_pEnt->Classify() == CLASS_SENTRYGUN ) ||
( trace.m_pEnt->Classify() == CLASS_DETPACK ) )
{
// If there's no owner bail out
if( !( ( ( CFFBuildableObject * )trace.m_pEnt )->CheckForOwner() ) )
return;
}
}
// END: Added by Mulch 11/07/2005
// If either of the entities is flagged to be deleted,
// don't call the touch functions
if ( ( GetFlags() | other->GetFlags() ) & FL_KILLME )
141014111412141314141415141614171418
// just crossed into water
EmitSound( "BaseEntity.EnterWater" );
Vector vecAbsVelocity = GetAbsVelocity();
vecAbsVelocity[2] *= 0.5;
SetAbsVelocity( vecAbsVelocity );
}
}
else
142814291430143114321433143414351436143714381439
// just crossed into water
EmitSound( "BaseEntity.EnterWater" );
// BEG: Removed by Mulch - it was deflecting
// stuff entering water
// Vector vecAbsVelocity = GetAbsVelocity();
// vecAbsVelocity[2] *= 0.5;
// SetAbsVelocity( vecAbsVelocity );
// END: Mulch
}
}
else
150515061507150815091510151115121513
{
// entity is trapped in another solid
// UNDONE: does this entity needs to be removed?
SetAbsVelocity(vec3_origin);
SetLocalAngularVelocity(vec3_angle);
return;
}
#if !defined( CLIENT_DLL )
1526152715281529153015311532153315341535153615371538
{
// entity is trapped in another solid
// UNDONE: does this entity needs to be removed?
// Jiggles: Added this conditional to "fix" the "pipes don't always explode when they hit a player" bug
if ( Classify() != CLASS_GLGRENADE )
{
SetAbsVelocity(vec3_origin);
SetLocalAngularVelocity(vec3_angle);
return;
}
}
#if !defined( CLIENT_DLL )