Source/ThunderBeast/QuakeToon/game/p_weapon.c
void PlayerNoise(edict_t *who, vec3_t where, int type)
{
	edict_t		*noise;

	if (type == PNOISE_WEAPON)
	{
		if (who->client->silencer_shots)
		{
			who->client->silencer_shots--;
			return;
		}
	}

	if (deathmatch->value)
		return;

	if (who->flags & FL_NOTARGET)
		return;


	if (!who->mynoise)
	{
		noise = G_Spawn();
		noise->classname = "player_noise";
		VectorSet (noise->mins, -8, -8, -8);
		VectorSet (noise->maxs, 8, 8, 8);
		noise->owner = who;
		noise->svflags = SVF_NOCLIENT;
		who->mynoise = noise;

		noise = G_Spawn();
		noise->classname = "player_noise";
		VectorSet (noise->mins, -8, -8, -8);
		VectorSet (noise->maxs, 8, 8, 8);
		noise->owner = who;
		noise->svflags = SVF_NOCLIENT;
		who->mynoise2 = noise;
	}

	if (type == PNOISE_SELF || type == PNOISE_WEAPON)
	{
		noise = who->mynoise;
		level.sound_entity = noise;
		level.sound_entity_framenum = level.framenum;
	}
	else // type == PNOISE_IMPACT
	{
		noise = who->mynoise2;
		level.sound2_entity = noise;
		level.sound2_entity_framenum = level.framenum;
	}

	VectorCopy (where, noise->s.origin);
	VectorSubtract (where, noise->maxs, noise->absmin);
	VectorAdd (where, noise->maxs, noise->absmax);
	noise->teleport_time = level.time;
	gi.linkentity (noise);
}
/*
===============
PlayerNoise

Each player can have two noise objects associated with it:
a personal noise (jumping, pain, weapon firing), and a weapon
target noise (bullet wall impacts)

Monsters that don't directly see the player can move
to a noise in hopes of seeing the player from there.
===============
*/
PlayerNoise
Each player can have two noise objects associated with it:
a personal noise (jumping, pain, weapon firing), and a weapon
target noise (bullet wall impacts)

Monsters that don't directly see the player can move
to a noise in hopes of seeing the player from there.
PlayerNoise Each player can have two noise objects associated with it : a personal noise ( jumping pain weapon firing ) and a weapon target noise ( bullet wall impacts ) Monsters that don ' t directly see the player can move to a noise in hopes of seeing the player from there .
void PlayerNoise(edict_t *who, vec3_t where, int type)
{
	edict_t		*noise;
	if (type == PNOISE_WEAPON)
	{
		if (who->client->silencer_shots)
		{
			who->client->silencer_shots--;
			return;
		}
	}
	if (deathmatch->value)
		return;
	if (who->flags & FL_NOTARGET)
		return;
	if (!who->mynoise)
	{
		noise = G_Spawn();
		noise->classname = "player_noise";
		VectorSet (noise->mins, -8, -8, -8);
		VectorSet (noise->maxs, 8, 8, 8);
		noise->owner = who;
		noise->svflags = SVF_NOCLIENT;
		who->mynoise = noise;
		noise = G_Spawn();
		noise->classname = "player_noise";
		VectorSet (noise->mins, -8, -8, -8);
		VectorSet (noise->maxs, 8, 8, 8);
		noise->owner = who;
		noise->svflags = SVF_NOCLIENT;
		who->mynoise2 = noise;
	}
	if (type == PNOISE_SELF || type == PNOISE_WEAPON)
	{
		noise = who->mynoise;
		level.sound_entity = noise;
		level.sound_entity_framenum = level.framenum;
	}
	else 
	{
		noise = who->mynoise2;
		level.sound2_entity = noise;
		level.sound2_entity_framenum = level.framenum;
	}
	VectorCopy (where, noise->s.origin);
	VectorSubtract (where, noise->maxs, noise->absmin);
	VectorAdd (where, noise->maxs, noise->absmax);
	noise->teleport_time = level.time;
	gi.linkentity (noise);
}
void PlayerNoise ( edict_t * who , vec3_t where , int type ) { edict_t * noise ; if ( type == PNOISE_WEAPON ) { if ( who -> client -> silencer_shots ) { who -> client -> silencer_shots -- ; return ; } } if ( deathmatch -> value ) return ; if ( who -> flags & FL_NOTARGET ) return ; if ( ! who -> mynoise ) { noise = G_Spawn ( ) ; noise -> classname = " " ; VectorSet ( noise -> mins , -8 , -8 , -8 ) ; VectorSet ( noise -> maxs , 8 , 8 , 8 ) ; noise -> owner = who ; noise -> svflags = SVF_NOCLIENT ; who -> mynoise = noise ; noise = G_Spawn ( ) ; noise -> classname = " " ; VectorSet ( noise -> mins , -8 , -8 , -8 ) ; VectorSet ( noise -> maxs , 8 , 8 , 8 ) ; noise -> owner = who ; noise -> svflags = SVF_NOCLIENT ; who -> mynoise2 = noise ; } if ( type == PNOISE_SELF || type == PNOISE_WEAPON ) { noise = who -> mynoise ; level . sound_entity = noise ; level . sound_entity_framenum = level . framenum ; } else { noise = who -> mynoise2 ; level . sound2_entity = noise ; level . sound2_entity_framenum = level . framenum ; } VectorCopy ( where , noise -> s . origin ) ; VectorSubtract ( where , noise -> maxs , noise -> absmin ) ; VectorAdd ( where , noise -> maxs , noise -> absmax ) ; noise -> teleport_time = level . time ; gi . linkentity ( noise ) ; }
PlayerNoise
Each player can have two noise objects associated with it:
a personal noise (jumping, pain, weapon firing), and a weapon
target noise (bullet wall impacts)
PlayerNoise Each player can have two noise objects associated with it : a personal noise ( jumping pain weapon firing ) and a weapon target noise ( bullet wall impacts )
// type == PNOISE_IMPACT