// Handles Squad Members' Names.
// Worthless Bums 2012.


function generateRandomCallsign ()
{//echo("generateRandomCallsign()");
	%callsign = getRandom(0, $marineNameListLength - 1);
	return $marineNameList[%callsign];
}
function generateName (%gender)
{//echo("generateName()");
	%name = generateRandomCallsign();
	// Enforce no duplication.
	if (isObject($playerSquad[0])	&&
		$playerSquad[0].name $= %name)
	{
		%name = generateName(%gender);
	}
	if (isObject($playerSquad[1])	&&
		$playerSquad[1].name $= %name)
	{
		%name = generateName(%gender);
	}
	if (isObject($playerSquad[2])	&&
		$playerSquad[2].name $= %name)
	{
		%name = generateName(%gender);
	}
	if (isObject($playerSquad[3])	&&
		$playerSquad[3].name $= %name)
	{
		%name = generateName(%gender);
	}
	return %name;
}