
class goCount expands Mutator;

var int bCapacity;

function PostBeginPlay()
{
	CheckFactories();
	log("Checking the factories");

	if (NextMutator != None)
      NextMutator.PostBeginPlay();
}

function CheckFactories()
{
   local ThingFactory T;
   local goCounter ex;

   foreach AllActors(class 'ThingFactory', T)
   {
      if(T !=none)
      {
//         log("found a factory: "$ T);
         if(T.Capacity < 0)
            T.Capacity=bCapacity;
         if(T.bCovert==True)
            T.bCovert=False;
         ex=Spawn(class'goCounter',,,T.location+vect(-1,-1,-1)); // right next to it
         ex.tag=T.Tag;
         ex.NumToCountA=T.Capacity;
         ex.prototypeA=T.prototype;
//         log("Made a goCounter: "$ ex);
      }
   }
}

defaultproperties
{
   bCapacity=50
}