diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index d34ad25d..45fd922c 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -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 ) pev->angles.z = RANDOM_LONG( 0, 360 ); pev->nextthink = gpGlobals->time + 10.0; - // g-cont. Setup movewith feature - pev->movetype = MOVETYPE_COMPOUND; // set movewith type - pev->aiment = ENT( pOther->pev ); // set parent + if (gPhysicsInterfaceInitialized) { + // g-cont. Setup movewith feature + pev->movetype = MOVETYPE_COMPOUND; // set movewith type + pev->aiment = ENT( pOther->pev ); // set parent + } } if( UTIL_PointContents( pev->origin ) != CONTENTS_WATER ) diff --git a/dlls/world.cpp b/dlls/world.cpp index fe119919..a065b5be 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -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 // fill engine callbacks memcpy( pFunctionTable, &gPhysicsInterface, sizeof(physics_interface_t) ); - + gPhysicsInterfaceInitialized = TRUE; return TRUE; }