
class CZone extends Actor;

//Thanks to Higor for allowing the use of the mesh!
#exec MESH IMPORT MESH=sgSphereMesh ANIVFILE=MODELS\sgSphereMesh_a.3d DATAFILE=MODELS\sgSphereMesh_d.3d X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=sgSphereMesh X=0 Y=0 Z=0

#exec MESH SEQUENCE MESH=sgSphereMesh SEQ=All 	STARTFRAME=0 	NUMFRAMES=1
#exec MESH SEQUENCE MESH=sgSphereMesh SEQ=Still STARTFRAME=0   NUMFRAMES=1 RATE=1.0

#exec MESHMAP NEW MESHMAP=sgSphereMesh MESH=sgSphereMesh
#exec MESHMAP SCALE MESHMAP=sgSphereMesh X=0.05 Y=0.05 Z=0.1

//These variables are to help force the mesh to be visible
var vector OriginalLocation;
var PlayerPawn LocalPlayer;

replication
{
   reliable if (Role == ROLE_Authority && bNetInitial)
      OriginalLocation;
}

simulated function PostBeginPlay()
{
   local PlayerPawn pp;

   if (Role == ROLE_Authority)
 	   OriginalLocation = Location;

   if (Level.NetMode != NM_DedicatedServer) 
   {
      foreach AllActors(class'PlayerPawn', pp) 
      {
         if (Viewport(pp.Player) != None) 
         {
            LocalPlayer = PP;
            break;
         }
      }
   }

   Super.PostBeginPlay();
}

simulated function Tick(float DeltaTime)
{
   local Actor ppActor;
   local vector ppViewLoc;
   local rotator ppViewRot;
   
   if (LocalPlayer != None) 
   {
      LocalPlayer.PlayerCalcView(ppActor, ppViewLoc, ppViewRot);
      SetLocation(ppViewLoc + (vect(256, 0, 0) >> ppViewRot));
      PrePivot = OriginalLocation - Location;
   }
}

defaultproperties
{
	Texture=WetTexture'UnrealShare.Belt_fx.Damagewet'
   bAlwaysRelevant=True
   RemoteRole=ROLE_SimulatedProxy
	LifeSpan=999999
   DrawType=DT_Mesh
   Style=STY_Translucent
	Mesh=LodMesh'sgSphereMesh'
   AmbientGlow=255
	bUnlit=True
}