Thread: Reducing damage
View Single Post
Reducing damage
Old
  (#1)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default Reducing damage - 16-08-2004

I have been using the following code to deny headshots to humans.
How would i modify this to reduce damage taken?
What I would like to do is deny all headshots and reduce all other damage to humans by half.

Code:
// ---------------------------------------------------------------------------------------
// TraceLine()
//
// Disallow headshot damange to human players 
// ---------------------------------------------------------------------------------------
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr)
{
  TRACE_LINE(v1, v2, fNoMonsters, pentToSkip, ptr);
  if ( ((1<<HITGROUP_HEAD) & (1<<ptr->iHitgroup)) && 
		!(ptr->pHit->v.flags & FL_FAKECLIENT)	   )
  {
	// return no damage
	ptr->flFraction = 1.0;
	RETURN_META(MRES_SUPERCEDE);
  }
  else
  {
	RETURN_META(MRES_IGNORED);
  }
}

Last edited by Austin; 16-08-2004 at 00:28..
  
Reply With Quote