//Spawn this with weapon to make a corpse overlayer effect
class X_Ion_CorpseOv expands Actor;

var float EffectRadius;

var() class<CorpseOv> CorpseOverlayer;

replication
{
	// Things the server should send to the client.
	reliable if( Role==ROLE_Authority)
		EffectRadius;
}

function PostBeginPlay()
{
	if (Class'NWMutator'.default.EnableCorpseOverlayers)
		SetTimer(0.1, False);
	else
		Destroy();
}


function Timer()
{
	local CorpseOv cov;
	local Actor A;

	ForEach RadiusActors( Class'Actor', A, EffectRadius * 1.5)
	//ForEach VisibleCollidingActors( Class'Actor', A, EffectRadius * 1.5)
	{
		if (A.DrawType == DT_Mesh && (A.IsA('Carcass') || A.IsA('Vehicle') || (A.IsA('Cybot') && !A.IsA('SphericalBarrier')) ))
			Spawn(CorpseOverlayer, A);

		if (A.IsA('Pawn'))
		{
			cov = Spawn(CorpseOverlayer, A);
			cov.bPawn = True;
		}
	}

	Destroy();
}


defaultproperties
{
	bHidden=True;
	CorpseOverlayer=class'CorpseOv'
}
