anchor.diff:    Result := -1;
     if InRange(aPlayer, 0, gHands.Count - 1) and (gHands[aPlayer].Enabled)
     and gTerrain.TileInMapCoords(X, Y)
  -  and ((aHouseType = -1) or (aHouseType in [Low(HouseIndexToType)..High(HouseIndexToType)])) then
  +  and ((aHouseType = -1) or HouseTypeValid(aHouseType)) then
     begin
       if aHouseType = -1 then
         HTS := [Low(THouseType)..High(THouseType)]
  
positive.code: function TKMScriptStates.HouseUnlocked(aPlayer, aHouseType: Word): Boolean;
  begin
    if InRange(aPlayer, 0, gHands.Count - 1) and (gHands[aPlayer].Enabled)
    and (aHouseType in [Low(HouseIndexToType)..High(HouseIndexToType)]) then
      Result := gHands[aPlayer].Stats.GetCanBuild(HouseIndexToType[aHouseType])
    else
    begin
  
negative.code: begin
    if InRange(aPlayer, 0, gHands.Count - 1) and (gHands[aPlayer].Enabled)
    and(aWareType in [Low(WareIndexToType) .. High(WareIndexToType)])
    and HouseTypeValid(aHouseType) then
      Result := gHands[aPlayer].Stats.Ratio[WareIndexToType[aWareType], HouseIndexToType[aHouseType]]
    else
    begin
  