Browse Source

Put MOVETYPE_COMPOUND usage under if

clcampaign
Roman Chistokhodov 8 years ago
parent
commit
56aa9f4a9c
  1. 8
      dlls/crossbow.cpp
  2. 4
      dlls/world.cpp

8
dlls/crossbow.cpp

@ -27,6 +27,8 @@ @@ -27,6 +27,8 @@
#define BOLT_AIR_VELOCITY 2000
#define BOLT_WATER_VELOCITY 1000
extern BOOL gPhysicsInterfaceInitialized;
// UNDONE: Save/restore this? Don't forget to set classname and LINK_ENTITY_TO_CLASS()
//
// OVERLOADS SOME ENTVARS:
@ -167,9 +169,11 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) @@ -167,9 +169,11 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
pev->angles.z = RANDOM_LONG( 0, 360 );
pev->nextthink = gpGlobals->time + 10.0;
if (gPhysicsInterfaceInitialized) {
// g-cont. Setup movewith feature
//pev->movetype = MOVETYPE_COMPOUND; // set movewith type
//pev->aiment = ENT( pOther->pev ); // set parent
pev->movetype = MOVETYPE_COMPOUND; // set movewith type
pev->aiment = ENT( pOther->pev ); // set parent
}
}
if( UTIL_PointContents( pev->origin ) != CONTENTS_WATER )

4
dlls/world.cpp

@ -822,6 +822,8 @@ static physics_interface_t gPhysicsInterface = @@ -822,6 +822,8 @@ static physics_interface_t gPhysicsInterface =
DispatchPhysicsEntity,
};
BOOL gPhysicsInterfaceInitialized = FALSE;
int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable )
{
if( !pFunctionTable || !pfuncsFromEngine || iVersion != SV_PHYSICS_INTERFACE_VERSION )
@ -834,6 +836,6 @@ int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEn @@ -834,6 +836,6 @@ int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEn
// fill engine callbacks
memcpy( pFunctionTable, &gPhysicsInterface, sizeof(physics_interface_t) );
gPhysicsInterfaceInitialized = TRUE;
return TRUE;
}

Loading…
Cancel
Save