anchor.diff:  
   function TKMScriptStates.HouseTypeName(aHouseType: Byte): AnsiString;
   begin
  -  if (aHouseType in [Low(HouseIndexToType) .. High(HouseIndexToType)]) then
  +  if HouseTypeValid(aHouseType) then
       Result := '<%' + AnsiString(IntToStr(gResource.HouseDat[HouseIndexToType[aHouseType]].HouseNameTextID)) + '>'
     else
     begin
  
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
    //Verify all input parameters
    if InRange(aPlayer, 0, gHands.Count - 1) and (gHands[aPlayer].Enabled)
    and HouseTypeValid(aHouseType) then
      gHands[aPlayer].Stats.HouseGranted[HouseIndexToType[aHouseType]] := True
    else
      LogError('Actions.HouseUnlock', [aPlayer, aHouseType]);
  