mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-04 17:50:30 +03:00
Merge pull request #272 from Blixibon/mapbase/feature/zombie-serverside-headcrab-ragdoll-fixes
Fix serverside zombie headcrab ragdoll not using correct origin
This commit is contained in:
commit
4e3f58f4b5
@ -2468,9 +2468,15 @@ bool CNPC_BaseZombie::ShouldPlayFootstepMoan( void )
|
||||
#define CRAB_HULL_EXPAND 1.1f
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CNPC_BaseZombie::HeadcrabFits( CBaseAnimating *pCrab )
|
||||
bool CNPC_BaseZombie::HeadcrabFits( CBaseAnimating *pCrab, const Vector *vecOrigin )
|
||||
{
|
||||
Vector vecSpawnLoc = pCrab->GetAbsOrigin();
|
||||
Vector vecSpawnLoc;
|
||||
#ifdef MAPBASE
|
||||
if (vecOrigin)
|
||||
vecSpawnLoc = *vecOrigin;
|
||||
else
|
||||
#endif
|
||||
vecSpawnLoc = pCrab->GetAbsOrigin();
|
||||
|
||||
CTraceFilterSimpleList traceFilter( COLLISION_GROUP_NONE );
|
||||
traceFilter.AddEntityToIgnore( pCrab );
|
||||
@ -2553,7 +2559,12 @@ void CNPC_BaseZombie::ReleaseHeadcrab( const Vector &vecOrigin, const Vector &ve
|
||||
SetHeadcrabSpawnLocation( iCrabAttachment, pAnimatingGib );
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
// Server ragdolls don't have a valid origin on spawn, so we have to use the origin originally passed
|
||||
if( !HeadcrabFits( pAnimatingGib, m_bForceServerRagdoll ? &vecOrigin : NULL ) )
|
||||
#else
|
||||
if( !HeadcrabFits(pAnimatingGib) )
|
||||
#endif
|
||||
{
|
||||
UTIL_Remove(pGib);
|
||||
return;
|
||||
@ -2570,11 +2581,20 @@ void CNPC_BaseZombie::ReleaseHeadcrab( const Vector &vecOrigin, const Vector &ve
|
||||
|
||||
if( UTIL_ShouldShowBlood(BLOOD_COLOR_YELLOW) )
|
||||
{
|
||||
UTIL_BloodImpact( pGib->WorldSpaceCenter(), Vector(0,0,1), BLOOD_COLOR_YELLOW, 1 );
|
||||
Vector vecGibCenter;
|
||||
#ifdef MAPBASE
|
||||
// Server ragdolls don't have a valid origin on spawn, so we have to use the origin originally passed
|
||||
if (m_bForceServerRagdoll)
|
||||
vecGibCenter = vecOrigin;
|
||||
else
|
||||
#endif
|
||||
vecGibCenter = pGib->WorldSpaceCenter();
|
||||
|
||||
UTIL_BloodImpact( vecGibCenter, Vector(0,0,1), BLOOD_COLOR_YELLOW, 1 );
|
||||
|
||||
for ( int i = 0 ; i < 3 ; i++ )
|
||||
{
|
||||
Vector vecSpot = pGib->WorldSpaceCenter();
|
||||
Vector vecSpot = vecGibCenter;
|
||||
|
||||
vecSpot.x += random->RandomFloat( -8, 8 );
|
||||
vecSpot.y += random->RandomFloat( -8, 8 );
|
||||
|
@ -189,7 +189,7 @@ public:
|
||||
virtual void SetModel( const char *szModelName );
|
||||
virtual void BecomeTorso( const Vector &vecTorsoForce, const Vector &vecLegsForce );
|
||||
virtual bool CanBecomeLiveTorso() { return false; }
|
||||
virtual bool HeadcrabFits( CBaseAnimating *pCrab );
|
||||
virtual bool HeadcrabFits( CBaseAnimating *pCrab, const Vector *vecOrigin = NULL );
|
||||
void ReleaseHeadcrab( const Vector &vecOrigin, const Vector &vecVelocity, bool fRemoveHead, bool fRagdollBody, bool fRagdollCrab = false );
|
||||
void SetHeadcrabSpawnLocation( int iCrabAttachment, CBaseAnimating *pCrab );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user