@@ -2468,9 +2468,15 @@ bool CNPC_BaseZombie::ShouldPlayFootstepMoan( void )
2468
2468
#define CRAB_HULL_EXPAND 1 .1f
2469
2469
// -----------------------------------------------------------------------------
2470
2470
// -----------------------------------------------------------------------------
2471
- bool CNPC_BaseZombie::HeadcrabFits ( CBaseAnimating *pCrab )
2471
+ bool CNPC_BaseZombie::HeadcrabFits ( CBaseAnimating *pCrab, const Vector *vecOrigin )
2472
2472
{
2473
- Vector vecSpawnLoc = pCrab->GetAbsOrigin ();
2473
+ Vector vecSpawnLoc;
2474
+ #ifdef MAPBASE
2475
+ if (vecOrigin)
2476
+ vecSpawnLoc = *vecOrigin;
2477
+ else
2478
+ #endif
2479
+ vecSpawnLoc = pCrab->GetAbsOrigin ();
2474
2480
2475
2481
CTraceFilterSimpleList traceFilter ( COLLISION_GROUP_NONE );
2476
2482
traceFilter.AddEntityToIgnore ( pCrab );
@@ -2553,7 +2559,12 @@ void CNPC_BaseZombie::ReleaseHeadcrab( const Vector &vecOrigin, const Vector &ve
2553
2559
SetHeadcrabSpawnLocation ( iCrabAttachment, pAnimatingGib );
2554
2560
}
2555
2561
2562
+ #ifdef MAPBASE
2563
+ // Server ragdolls don't have a valid origin on spawn, so we have to use the origin originally passed
2564
+ if ( !HeadcrabFits ( pAnimatingGib, m_bForceServerRagdoll ? &vecOrigin : NULL ) )
2565
+ #else
2556
2566
if ( !HeadcrabFits (pAnimatingGib) )
2567
+ #endif
2557
2568
{
2558
2569
UTIL_Remove (pGib);
2559
2570
return ;
@@ -2570,11 +2581,20 @@ void CNPC_BaseZombie::ReleaseHeadcrab( const Vector &vecOrigin, const Vector &ve
2570
2581
2571
2582
if ( UTIL_ShouldShowBlood (BLOOD_COLOR_YELLOW) )
2572
2583
{
2573
- UTIL_BloodImpact ( pGib->WorldSpaceCenter (), Vector (0 ,0 ,1 ), BLOOD_COLOR_YELLOW, 1 );
2584
+ Vector vecGibCenter;
2585
+ #ifdef MAPBASE
2586
+ // Server ragdolls don't have a valid origin on spawn, so we have to use the origin originally passed
2587
+ if (m_bForceServerRagdoll)
2588
+ vecGibCenter = vecOrigin;
2589
+ else
2590
+ #endif
2591
+ vecGibCenter = pGib->WorldSpaceCenter ();
2592
+
2593
+ UTIL_BloodImpact ( vecGibCenter, Vector (0 ,0 ,1 ), BLOOD_COLOR_YELLOW, 1 );
2574
2594
2575
2595
for ( int i = 0 ; i < 3 ; i++ )
2576
2596
{
2577
- Vector vecSpot = pGib-> WorldSpaceCenter () ;
2597
+ Vector vecSpot = vecGibCenter ;
2578
2598
2579
2599
vecSpot.x += random->RandomFloat ( -8 , 8 );
2580
2600
vecSpot.y += random->RandomFloat ( -8 , 8 );
0 commit comments