//=============================================================================
// TeamTrigger: triggers for all except pawns with matching team
//=============================================================================
class TeamTrigger expands Trigger;

var() byte Team;

function Touch( actor Other )
{
	if ( Other.IsA('Pawn') && Level.Game.IsA('TeamGamePlus') 
		&& !TeamGamePlus(Level.Game).IsOnTeam(Pawn(Other), Team) )
		Super.Touch(Other);
}

function Timer()
{
	local bool bKeepTiming;
	local int i;

	bKeepTiming = false;

	for (i=0;i<4;i++)
		if ( (Touching[i] != None) 
			&& (!Touching[i].IsA('Pawn') || (Pawn(Touching[i]).PlayerReplicationInfo.Team != Team))
			&& IsRelevant(Touching[i]) )
		{
			bKeepTiming = true;
			Touch(Touching[i]);
		}

	if ( bKeepTiming )
		SetTimer(RepeatTriggerTime, false);
}

//
// When something untouches the trigger.
//
function UnTouch( actor Other )
{
	if ( !Other.IsA('Pawn') || (Pawn(Other).PlayerReplicationInfo.Team != Team) )
		Super.UnTouch(Other);
}