// SpawnNotify for the UTCompass HUD mutator.
class UTCNotify expands SpawnNotify;

var int iCompassOffset;

Replication 
{
	Reliable if(Role >= ROLE_Authority)
		iCompassOffset;
}

simulated function PostBeginPlay() 
{
	local HUD MyHud;

	foreach AllActors(class'HUD',MyHud)
	{
		SpawnNotification(MyHud);
	}
	Super.PostBeginPlay();
}

simulated event Actor SpawnNotification(Actor A) 
{
	local mutator M;

	if(HUD(A).HUDMutator == none)
	{
		HUD(A).HUDMutator = spawn(class'UTCHUD',A);
		UTCHUD(HUD(A).HUDMutator).iCompassOffset = iCompassOffset;
	}
	else
	{
		m=HUD(A).HUDMutator;
		while(m!=none)
		{
			if(m.class==Class'BRUT.UTCHUD')
			{
				UTCHUD(m).iCompassOffset = iCompassOffset;
				return A;
			}
			else m=m.nextHUDMutator;
		}
		m=HUD(A).HUDMutator;
		HUD(A).HUDMutator=spawn(class'UTCHUD',A);
		HUD(A).HUDMutator.nextHUDMutator=m;
		UTCHUD(HUD(A).HUDMutator).iCompassOffset = iCompassOffset;
	}
	return A;
}

defaultproperties
{
    ActorClass=Class'Engine.HUD'
}
