anchor.diff:    INIT_HOUSE_INFLUENCE = 255;
     MAX_INFLUENCE_DISTANCE = 150;
   var
  -  AI: Boolean;
  -  I, Cnt: Integer;
  +  isAI: Boolean;
  +  I, cnt: Integer;
     H: TKMHouse;
  -  IdxArray: TKMWordArray;
  -begin
  -  //Clear array (is better to clear ~3000 polygons instead of 255*255 tiles)
  +  idxArray: TKMWordArray;
  +begin
  +  //Clear array (it is better to clear ~3000 polygons instead of 255*255 tiles)
     FillChar(fOwnership[aPL*fPolyCnt], SizeOf(fOwnership[0]) * fPolyCnt, #0);
   
     // Create array of polygon indexes
  -  SetLength(IdxArray, gHands[aPL].Houses.Count);
  -  Cnt := 0;
  -  AI := gHands[aPL].IsComputer;
  +  SetLength(idxArray, gHands[aPL].Houses.Count);
  +  cnt := 0;
  +  isAI := gHands[aPL].IsComputer;
     for I := 0 to gHands[aPL].Houses.Count - 1 do
     begin
       H := gHands[aPL].Houses[I];
       if not H.IsDestroyed
  -      AND not (H.HouseType in [htWatchTower, htWoodcutters])
  -      AND (AI OR H.IsComplete) then // Player must finish the house to update influence so he cannot troll the AI
  +    and not (H.HouseType in [htWatchTower, htWoodcutters])
  +    and (isAI or H.IsComplete) then // Player must finish the house to update influence so he cannot troll the AI
       begin
  -        IdxArray[Cnt] := fNavMesh.KMPoint2Polygon[ H.PointBelowEntrance ]; // Use point below entrance to match NavMeshDefence algorithm and city center detection in Eye
  -        Cnt := Cnt + 1;
  +      // Use point below entrance to match NavMeshDefence algorithm and city center detection in Eye
  +      idxArray[cnt] := fNavMesh.KMPoint2Polygon[H.PointBelowEntrance];
  +      Inc(cnt);
       end;
     end;
   
  -  if (Cnt > 0) then
  -    fInfluenceFloodFill.HouseInfluence(aPL, INIT_HOUSE_INFLUENCE, MAX_INFLUENCE_DISTANCE, Cnt - 1, IdxArray);
  +  if cnt > 0 then
  +    fInfluenceFloodFill.HouseInfluence(aPL, INIT_HOUSE_INFLUENCE, MAX_INFLUENCE_DISTANCE, cnt - 1, idxArray);
   end;
   
   
  
positive.code: 
  
  type
  
    //Collection of influence maps
    TKMInfluences = class
    private
      fMapX, fMapY, fPolyCnt: Word; // Limits of arrays
  
negative.code: 
  function TKMInfluences.CanPlaceHouseByInfluence(const aPL: TKMHandID; const aIdx: Word; const aIgnoreAllies: Boolean = False): Boolean;
  var
    bestOwner: TKMHandID;
  begin
    bestOwner := GetBestOwner(aIdx);
    Result := (bestOwner >= 0) AND (OwnPoly[aPL, aIdx] > 0) AND ((bestOwner = aPL) OR (not aIgnoreAllies AND (gHands[aPL].Alliances[bestOwner] = atAlly)));
  end;
  
  
  