Guest User

Untitled

a guest
Aug 19th, 2016
35
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. ================
  3. rvVehicle::AddDamageEffect
  4. ================
  5. */
  6. void rvVehicle::AddDamageEffect ( const trace_t &collision, const idVec3 &velocity, const char *damageDefName, idEntity* inflictor ) {
  7.  
  8. //militia_add
  9. if ( vfl.dead ) {
  10. return;
  11. }
  12.  
  13. if ( lastshieldHit + 200 < gameLocal.time ) {
  14. vfl.fx_shield = false;
  15. }
  16.  
  17. if ( !vfl.fx_shield && shieldHealth.GetCurrentValue ( gameLocal.time ) > 0 ) {
  18. idVec3 jointOrigin;
  19. idMat3 jointAxis;
  20.  
  21. idVec3 dir;
  22. dir = collision.c.point - GetPhysics()->GetCenterMass ();
  23. dir.NormalizeFast ( );
  24.  
  25. lastshieldHit = gameLocal.time;
  26.  
  27. jointHandle_t joint = animator.GetJointHandle( spawnArgs.GetString( "fx_shield_joint", "" ) );
  28.  
  29. if ( joint != INVALID_JOINT ) {
  30. GetJointWorldTransform ( joint, gameLocal.time, jointOrigin, jointAxis );
  31. } else {
  32. jointOrigin = collision.c.point;
  33. jointAxis = dir.ToMat3();
  34. }
  35.  
  36. vfl.fx_shield = true;
  37. gameLocal.PlayEffect ( gameLocal.GetEffect( spawnArgs, "fx_shield" ), jointOrigin, jointAxis, false, vec3_origin, true, false, EC_IGNORE, GetHitscanTint() );
  38.  
  39. }
  40. //militia_end
  41. }
RAW Paste Data