anchor.diff:        G := fIDCache.GetGroup(aGroupID);
         if G <> nil then
         begin
  -        DefPos := gHands[G.Owner].AI.General.DefencePositions.FindPositionOf(G);
  -        if DefPos <> nil then
  -          Result := (DefPos.Position.Loc.X = X) and (DefPos.Position.Loc.Y = Y);
  +        if not gHands[G.Owner].AI.Setup.NewAI then
  +        begin
  +          DefPosNewAI := gHands[G.Owner].AI.ArmyManagement.Defence.FindPositionOf(G);
  +          if DefPosNewAI <> nil then
  +            Result := (DefPos.Position.Loc.X = X) and (DefPos.Position.Loc.Y = Y);
  +        end
  +        else
  +        begin
  +          DefPos := gHands[G.Owner].AI.General.DefencePositions.FindPositionOf(G);
  +          if DefPos <> nil then
  +              Result := (DefPos.Position.Loc.X = X) and (DefPos.Position.Loc.Y = Y)
  +        end;
         end;
       end
       else
  
positive.code:   KM_AI, KM_Terrain, KM_Game, KM_FogOfWar, KM_UnitWarrior,
    KM_HouseBarracks, KM_HouseSchool, KM_ResUnits, KM_Log, KM_CommonUtils, KM_HouseMarket,
    KM_Resource, KM_UnitTaskSelfTrain, KM_Sound, KM_Hand, KM_AIDefensePos, KM_CommonClasses,
    KM_UnitsCollection, KM_PathFindingRoad, KM_HouseWoodcutters, KM_HouseTownHall;
  
  
    //We need to check all input parameters as could be wildly off range due to
  
negative.code: var
    G: TKMUnitGroup;
    DefPos: TAIDefencePosition;
    DefPosNewAI: TKMDefencePosition;
  begin
    try
      Result := False;
  