Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. HeadcrabRelease_t CNPC_BaseZombie::ShouldReleaseHeadcrab( const CTakeDamageInfo &info, float flDamageThreshold )
  2. {
  3. if ( m_iHealth <= 0 )
  4. {
  5. if ( info.GetDamageType() & DMG_REMOVENORAGDOLL )
  6. return RELEASE_NO;
  7.  
  8. if ( info.GetDamageType() & DMG_SNIPER )
  9. return RELEASE_RAGDOLL;
  10.  
  11. // If I was killed by a bullet...
  12. if ( info.GetDamageType() & DMG_BULLET )
  13. {
  14. if( m_bHeadShot )
  15. {
  16. if( flDamageThreshold > 0.25 )
  17. {
  18. // Enough force to kill the crab.
  19. return RELEASE_RAGDOLL;
  20. }
  21. }
  22. else
  23. {
  24. // Killed by a shot to body or something. Crab is ok!
  25. return RELEASE_IMMEDIATE;
  26. }
  27. }
  28.  
  29. // If I was killed by an explosion, release the crab.
  30. if ( info.GetDamageType() & DMG_BLAST )
  31. {
  32. return RELEASE_RAGDOLL;
  33. }
  34.  
  35. if ( m_fIsTorso && IsChopped( info ) )
  36. {
  37. return RELEASE_RAGDOLL_SLICED_OFF;
  38. }
  39. }
  40.  
  41. return RELEASE_NO;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement