anchor.diff:    for I := 0 to gHands[aPL].Houses.Count - 1 do
     begin
       H := gHands[aPL].Houses[I];
  -    if not H.IsDestroyed AND (H.HouseType <> ht_WatchTower) then  // Ignore watchtower?????????????????????????????????????????????
  +    if not H.IsDestroyed AND (H.HouseType <> ht_WatchTower) then  // Ignore watchtower?
       begin
  -      Idx := fNavMesh.FindClosestPolygon( H.GetPosition );
  -      if (Idx <> High(Word)) then
  -      begin
  -        IdxArray[Cnt] := Idx;
  +        IdxArray[Cnt] := fNavMesh.Point2Polygon[H.GetPosition.Y,H.GetPosition.X];
           Cnt := Cnt + 1;
  -      end;
       end;
     end;
   
  
positive.code: 
      // Avoid building
      // Army presence
      property PresenceAllGroups[const aPL: TKMHandIndex; aIdx: Word]: Word read GetAllPresences;
      property Presence[const aPL: TKMHandIndex; const aIdx: Word; const aGT: TGroupType]: Word read GetPresence write SetPresence;
      property IncPresence[const aPL: TKMHandIndex; aIdx: Word; const aGT: TGroupType]: Word write SetIncPresence;
      // City influence
      property Ownership[const aPL: TKMHandIndex; aY,aX: Word]: Byte read GetOwnershipFromPoint write SetOwnershipFromPoint; // To secure compatibility with old AI
      property OwnPoly[const aPL: TKMHandIndex; const aIdx: Word]: Byte read GetOwnership write SetOwnership;
      // Common
      property InfluenceSearch: TNavMeshInfluenceSearch read fInfluenceSearch write fInfluenceSearch;
  
negative.code: begin
    aIdx := ((aPL*fPolygons + aIdx) shl 2) + Byte(aGT);
    fPresence[aIdx] := fPresence[aIdx] + aPresence;
  end;
  
  
  function TKMInfluences.GetEnemyGroupPresence(const aPL: TKMHandIndex; const aIdx: Word; const aGT: TGroupType): Word;
  var
    PL: TKMHandIndex;
  begin
    Result := 0;
    for PL := 0 to gHands.Count - 1 do
      if gHands[PL].Enabled AND (gHands[aPL].Alliances[PL] = at_Enemy) then
        Result := Result + Presence[PL, aIdx, aGT];
  end;
  
  
  procedure TKMInfluences.UpdateMilitaryPresence(const aPL: TKMHandIndex);
  const
    EACH_X_MEMBER_COEF = 10;
    MAX_DISTANCE = 20;
  var
    I, K, Cnt: Integer;
    GT: TGroupType;
  