p_inter.c
/* 
=================== 
= 
= P_GiveWeapon
=
= The weapon name may have a MF_DROPPED flag ored in
=================== 
*/
P_GiveWeapon
The weapon name may have a MF_DROPPED flag ored in
P_GiveWeapon The weapon name may have a MF_DROPPED flag ored in
boolean P_GiveWeapon (player_t *player, weapontype_t weapon, boolean dropped)
{
	boolean		gaveammo, gaveweapon;
	if (netgame == gt_coop && !dropped)
	{	
		if (player->weaponowned[weapon])
			return false;
		player->weaponowned[weapon] = true;
		P_GiveAmmo (player, weaponinfo[weapon].ammo, 2);
		player->pendingweapon = weapon;
		S_StartSound (player->mo, sfx_wpnup);
		return false;
	}
	if (weaponinfo[weapon].ammo != am_noammo)
	{	
		if (dropped)
			gaveammo = P_GiveAmmo (player, weaponinfo[weapon].ammo, 1);
		else
			gaveammo = P_GiveAmmo (player, weaponinfo[weapon].ammo, 2);
	}
	else
		gaveammo = false;
	if (player->weaponowned[weapon])
		gaveweapon = false;
	else
	{
		gaveweapon = true;
		player->weaponowned[weapon] = true;
		player->pendingweapon = weapon;
		if (player == &players[consoleplayer])
			stbar.specialFace = f_gotgat;
	}
	return gaveweapon || gaveammo;
}
boolean P_GiveWeapon ( player_t * player , weapontype_t weapon , boolean dropped ) { boolean gaveammo , gaveweapon ; if ( netgame == gt_coop && ! dropped ) { if ( player -> weaponowned [ weapon ] ) return false ; player -> weaponowned [ weapon ] = true ; P_GiveAmmo ( player , weaponinfo [ weapon ] . ammo , 2 ) ; player -> pendingweapon = weapon ; S_StartSound ( player -> mo , sfx_wpnup ) ; return false ; } if ( weaponinfo [ weapon ] . ammo != am_noammo ) { if ( dropped ) gaveammo = P_GiveAmmo ( player , weaponinfo [ weapon ] . ammo , 1 ) ; else gaveammo = P_GiveAmmo ( player , weaponinfo [ weapon ] . ammo , 2 ) ; } else gaveammo = false ; if ( player -> weaponowned [ weapon ] ) gaveweapon = false ; else { gaveweapon = true ; player -> weaponowned [ weapon ] = true ; player -> pendingweapon = weapon ; if ( player == & players [ consoleplayer ] ) stbar . specialFace = f_gotgat ; } return gaveweapon || gaveammo ; }
P_GiveWeapon
The weapon name may have a MF_DROPPED flag ored in
P_GiveWeapon The weapon name may have a MF_DROPPED flag ored in
/* leave placed weapons forever on cooperative net games */ /* give one clip with a dropped weapon, two clips with a found weapon */