anchor.diff:    // First line of defences
     PolyArr := gAIFields.NavMesh.Polygons;
     NodeArr := gAIFields.NavMesh.Nodes;
  -  for I := 0 to Length(fDefPolyFirstLine) - 1 do
  -  begin
  -    Threat := 0;
  -    Idx := fDefPolyFirstLine[I];
  -    for GT := Low(TKMGroupType) to High(TKMGroupType) do
  -      Threat := Threat + gAIFields.Influences.EnemyGroupPresence[ fOwner, Idx, GT ];
  -
  -    // Draw defensive lines as a triangles
  -    Col := Max( $22, Min($FF, Threat) );
  -    gRenderAux.TriangleOnTerrain(
  -      NodeArr[PolyArr[Idx].Indices[0]].X,
  -      NodeArr[PolyArr[Idx].Indices[0]].Y,
  -      NodeArr[PolyArr[Idx].Indices[1]].X,
  -      NodeArr[PolyArr[Idx].Indices[1]].Y,
  -      NodeArr[PolyArr[Idx].Indices[2]].X,
  -      NodeArr[PolyArr[Idx].Indices[2]].Y, (Col shl 24) OR COLOR_RED);
  -
  -    // Draw hostile units around defensive lines
  -    if (Threat > 0) then
  -    begin
  -      Loc := gAIFields.NavMesh.Polygons[Idx].CenterPoint;
  -      UGA := gHands.GetGroupsInRadius(Loc, SQR_FIRST_LINE_RADIUS, fOwner, at_Enemy);
  -      for K := 0 to Length(UGA) - 1 do
  +  for I := 0 to fPositions.Count - 1 do
  +    if (Positions[I].Line = 0) then
  +    begin
  +      Threat := 0;
  +      Loc := Positions[I].Position.Loc;
  +      Idx := gAIFields.NavMesh.KMPoint2Polygon[Loc];
  +      for GT := Low(TKMGroupType) to High(TKMGroupType) do
  +        Threat := Threat + gAIFields.Influences.EnemyGroupPresence[ fOwner, Idx, GT ];
  +
  +      // Draw defensive lines as a triangles
  +      Col := Max( $22, Min($FF, Threat) );
  +      gRenderAux.TriangleOnTerrain(
  +        NodeArr[PolyArr[Idx].Indices[0]].X,
  +        NodeArr[PolyArr[Idx].Indices[0]].Y,
  +        NodeArr[PolyArr[Idx].Indices[1]].X,
  +        NodeArr[PolyArr[Idx].Indices[1]].Y,
  +        NodeArr[PolyArr[Idx].Indices[2]].X,
  +        NodeArr[PolyArr[Idx].Indices[2]].Y, (Col shl 24) OR COLOR_RED);
  +
  +      // Draw hostile units around defensive lines
  +      if (Threat > 0) then
         begin
  -        Pos := UGA[K].Position;
  -        gRenderAux.CircleOnTerrain(Pos.X, Pos.Y, 1, $44000000 OR COLOR_RED, $FF000000 OR COLOR_RED);
  -        //gRenderAux.LineOnTerrain(Pos, Loc, $AA000000 OR COLOR_BLACK);
  +        UGA := gHands.GetGroupsInRadius(Loc, SQR_FIRST_LINE_RADIUS, fOwner, at_Enemy);
  +        for K := 0 to Length(UGA) - 1 do
  +        begin
  +          Pos := UGA[K].Position;
  +          gRenderAux.CircleOnTerrain(Pos.X, Pos.Y, 1, $44000000 OR COLOR_RED, $FF000000 OR COLOR_RED);
  +          //gRenderAux.LineOnTerrain(Pos, Loc, $AA000000 OR COLOR_BLACK);
  +        end;
         end;
       end;
  -  end;
   end;
   
   
  
positive.code:     procedure SetPosition(const Value: TKMPointDir);
      function GetGroupType(): TKMGroupType;
    public
      constructor Create(aWeight: Word; aPos: TKMPointDir);
      constructor Load(LoadStream: TKMemoryStream);
      destructor Destroy; override;
      procedure Save(SaveStream: TKMemoryStream);
      procedure SyncLoad();
  
      property Weight: Word read fWeight write fWeight;
      property Position: TKMPointDir read fPosition write SetPosition; //Position and direction the group defending will stand
      property Group: TKMUnitGroup read fGroup write SetGroup;
  
negative.code:   SaveStream.Write(fFirstLineCnt);
    SaveStream.Write(TroopFormations, SizeOf(TroopFormations));
  
    SaveStream.Write(Count);
    for I := 0 to Count - 1 do
      Positions[I].Save(SaveStream);
  