anchor.diff:  function TKMScriptStates.ClosestHouse(aPlayer, X, Y, aHouseType: Integer): Integer;
   var
     HT: TKMHouseType;
  -  hasError: Boolean;
  -begin
  -  hasError := False;
  +begin
  +  Result := -1;
  +  HT := htNone;
     if aHouseType = -1 then
       HT := htAny
     else
     if HouseTypeValid(aHouseType) then
  -    HT := HOUSE_ID_TO_TYPE[aHouseType]
  -  else
  -    hasError := True;
  -
  -  if not hasError then
  +    HT := HOUSE_ID_TO_TYPE[aHouseType];
  +
  +  if HT <> htNone then
       Result := _ClosestHouse(aPlayer, X, Y, HT, 'States.ClosestHouse')
     else
       LogParamWarning('States.ClosestHouse', [aPlayer, X, Y, Byte(aHouseType)]);
  
positive.code:   B: Byte;
    GTS: TKMGroupTypeSet;
  begin
    Result := -1;
    GTS := [];
    for B in [Byte(Low(TKMGroupType))..Byte(High(TKMGroupType))] do
      if B in aGroupTypes then
  
negative.code: var
    G: TKMUnitGroup;
  begin
    Result := -1;
    try
      if InRange(aPlayer, 0, gHands.Count - 1) and (gHands[aPlayer].Enabled)
        and gTerrain.TileInMapCoords(X, Y) then
      begin
        G := gHands[aPlayer].UnitGroups.GetClosestGroup(KMPoint(X,Y), aGroupTypes);
        if G <> nil then
  