anchor.diff:    Result := -1;
     if InRange(aPlayer, 0, gHands.Count - 1)
     and (gHands[aPlayer].Enabled)
  -  and (aHouseType in [Low(HouseIndexToType)..High(HouseIndexToType)])
  +  and HouseTypeValid(aHouseType)
     and gTerrain.TileInMapCoords(X,Y) then
     begin
       NonEntranceX := X - gResource.HouseDat[HouseIndexToType[aHouseType]].EntranceOffsetX;
  
positive.code: begin
    //Verify all input parameters
    if InRange(aPlayer, 0, gHands.Count - 1) and (gHands[aPlayer].Enabled)
    and (aHouseType in [Low(HouseIndexToType) .. High(HouseIndexToType)]) then
      gHands[aPlayer].Stats.HouseGranted[HouseIndexToType[aHouseType]] := True
    else
      LogError('Actions.HouseUnlock', [aPlayer, aHouseType]);
  
negative.code: begin
    if (aWareType in [Low(WareIndexToType) .. High(WareIndexToType)])
    and (WareIndexToType[aWareType] in [wt_Steel, wt_Coal, wt_Wood, wt_Corn])
    and HouseTypeValid(aHouseType)
    and InRange(aPlayer, 0, gHands.Count - 1) and (gHands[aPlayer].Enabled) 
    and InRange(aAmount, 0, 5) then
    begin
  