From 408a63200216a3f581d13eca83a26384a6e01841 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Mon, 26 Aug 2024 21:25:39 +0000 Subject: [PATCH] Deprecate artifact-related building types --- client/CPlayerInterface.cpp | 2 +- client/windows/CCastleInterface.cpp | 165 +++++++++++++++------------- client/windows/CCastleInterface.h | 3 +- client/windows/GUIClasses.cpp | 5 +- client/windows/GUIClasses.h | 2 +- config/buildingsLibrary.json | 26 ++++- config/factions/castle.json | 2 +- config/factions/conflux.json | 6 +- config/factions/dungeon.json | 4 +- config/factions/fortress.json | 2 +- config/factions/inferno.json | 2 +- config/factions/necropolis.json | 4 +- config/factions/rampart.json | 2 +- config/factions/stronghold.json | 4 +- config/factions/tower.json | 4 +- config/schemas/townBuilding.json | 7 +- lib/constants/Enumerations.h | 5 - lib/constants/StringConstants.h | 5 - lib/mapObjects/CGTownInstance.cpp | 9 +- 19 files changed, 141 insertions(+), 118 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 8d1ffa9a6..1a8aa7cf8 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1673,7 +1673,7 @@ void CPlayerInterface::showUniversityWindow(const IMarket *market, const CGHeroI auto onWindowClosed = [this, queryID](){ cb->selectionMade(0, queryID); }; - GH.windows().createAndPushWindow(visitor, market, onWindowClosed); + GH.windows().createAndPushWindow(visitor, BuildingID::NONE, market, onWindowClosed); } void CPlayerInterface::showHillFortWindow(const CGObjectInstance *object, const CGHeroInstance *visitor) diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index 1ed818758..7b8f2f660 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -145,7 +145,7 @@ void CBuildingRect::clickPressed(const Point & cursorPosition) if(getBuilding() && area && (parent->selectedBuilding==this)) { auto building = getBuilding(); - parent->buildingClicked(building->bid, building->subId, building->upgrade); + parent->buildingClicked(building->bid); } } @@ -681,24 +681,78 @@ const CGHeroInstance * CCastleBuildings::getHero() return town->garrisonHero; } -void CCastleBuildings::buildingClicked(BuildingID building, BuildingSubID::EBuildingSubID subID, BuildingID upgrades) +void CCastleBuildings::buildingClicked(BuildingID building) { - logGlobal->trace("You've clicked on %d", (int)building.toEnum()); - const CBuilding *b = town->town->buildings.find(building)->second; - - if (town->getWarMachineInBuilding(building).hasValue()) + BuildingID buildingToEnter = building; + for(;;) { - enterBlacksmith(building, town->getWarMachineInBuilding(building)); - return; + const CBuilding *b = town->town->buildings.find(buildingToEnter)->second; + + if (buildingTryActivateCustomUI(buildingToEnter, building)) + return; + + if (!b->upgrade.hasValue()) + { + enterBuilding(building); + return; + } + + buildingToEnter = b->upgrade; + } +} + +bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, BuildingID buildingTarget) +{ + logGlobal->trace("You've clicked on %d", (int)buildingToTest.toEnum()); + const CBuilding *b = town->town->buildings.at(buildingToTest); + + if (town->getWarMachineInBuilding(buildingToTest).hasValue()) + { + enterBlacksmith(buildingTarget, town->getWarMachineInBuilding(buildingToTest)); + return true; } - if (building >= BuildingID::DWELL_FIRST) + // FIXME: implement correct visiting of thieves guild + + if (!b->marketModes.empty()) { - enterDwelling((BuildingID::getLevelFromDwelling(building))); + switch (*b->marketModes.begin()) + { + case EMarketMode::CREATURE_UNDEAD: + GH.windows().createAndPushWindow(town, getHero(), nullptr); + return true; + + case EMarketMode::RESOURCE_SKILL: + if (getHero()) + GH.windows().createAndPushWindow(getHero(), buildingTarget, town, nullptr); + return true; + + case EMarketMode::RESOURCE_RESOURCE: + // can't use allied marketplace + if (town->getOwner() == LOCPLINT->playerID) + { + GH.windows().createAndPushWindow(town, getHero(), nullptr, *b->marketModes.begin()); + return true; + } + else + return false; + default: + if(getHero()) + GH.windows().createAndPushWindow(town, getHero(), nullptr, *b->marketModes.begin()); + else + LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s. + return true; + } + } + + if (buildingToTest >= BuildingID::DWELL_FIRST) + { + enterDwelling((BuildingID::getLevelFromDwelling(buildingToTest))); + return true; } else { - switch(building) + switch(buildingToTest) { case BuildingID::MAGES_GUILD_1: case BuildingID::MAGES_GUILD_2: @@ -706,117 +760,74 @@ void CCastleBuildings::buildingClicked(BuildingID building, BuildingSubID::EBuil case BuildingID::MAGES_GUILD_4: case BuildingID::MAGES_GUILD_5: enterMagesGuild(); - break; + return true; case BuildingID::TAVERN: LOCPLINT->showTavernWindow(town, nullptr, QueryID::NONE); - break; + return true; case BuildingID::SHIPYARD: if(town->shipyardStatus() == IBoatGenerator::GOOD) + { LOCPLINT->showShipyardDialog(town); + return true; + } else if(town->shipyardStatus() == IBoatGenerator::BOAT_ALREADY_BUILT) + { LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]); - break; + return true; + } + return false; case BuildingID::FORT: case BuildingID::CITADEL: case BuildingID::CASTLE: GH.windows().createAndPushWindow(town); - break; + return true; case BuildingID::VILLAGE_HALL: case BuildingID::CITY_HALL: case BuildingID::TOWN_HALL: case BuildingID::CAPITOL: enterTownHall(); - break; - - case BuildingID::MARKETPLACE: - // can't use allied marketplace - if (town->getOwner() == LOCPLINT->playerID) - GH.windows().createAndPushWindow(town, town->visitingHero, nullptr, EMarketMode::RESOURCE_RESOURCE); - else - enterBuilding(building); - break; + return true; case BuildingID::SHIP: LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]); //Cannot build another boat - break; + return true; case BuildingID::SPECIAL_1: case BuildingID::SPECIAL_2: case BuildingID::SPECIAL_3: case BuildingID::SPECIAL_4: - switch (subID) + switch (b->subId) { - case BuildingSubID::NONE: - enterBuilding(building); - break; - case BuildingSubID::MYSTIC_POND: - enterFountain(building, subID, upgrades); - break; - - case BuildingSubID::ARTIFACT_MERCHANT: - if(town->visitingHero) - GH.windows().createAndPushWindow(town, town->visitingHero, nullptr, EMarketMode::RESOURCE_ARTIFACT); - else - LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s. - break; - - case BuildingSubID::FOUNTAIN_OF_FORTUNE: - enterFountain(building, subID, upgrades); - break; - - case BuildingSubID::FREELANCERS_GUILD: - if(getHero()) - GH.windows().createAndPushWindow(town, getHero(), nullptr, EMarketMode::CREATURE_RESOURCE); - else - LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s. - break; - - case BuildingSubID::MAGIC_UNIVERSITY: - if (getHero()) - GH.windows().createAndPushWindow(getHero(), town, nullptr); - else - enterBuilding(building); - break; + enterFountain(buildingToTest, b->subId, buildingTarget); + return true; case BuildingSubID::CASTLE_GATE: if (LOCPLINT->makingTurn) + { enterCastleGate(); - else - enterBuilding(building); - break; - - case BuildingSubID::CREATURE_TRANSFORMER: //Skeleton Transformer - GH.windows().createAndPushWindow(town, getHero(), nullptr); - break; + return true; + } + return false; case BuildingSubID::PORTAL_OF_SUMMONING: if (town->creatures[town->town->creatures.size()].second.empty())//No creatures LOCPLINT->showInfoDialog(CGI->generaltexth->tcommands[30]); else enterDwelling(town->town->creatures.size()); - break; + return true; case BuildingSubID::BANK: enterBank(); - break; - - default: - if(upgrades == BuildingID::TAVERN) - LOCPLINT->showTavernWindow(town, nullptr, QueryID::NONE); - else - enterBuilding(building); - break; + return true; } - break; - + return false; default: - enterBuilding(building); - break; + return false; } } } diff --git a/client/windows/CCastleInterface.h b/client/windows/CCastleInterface.h index 54d0749f1..c756c1236 100644 --- a/client/windows/CCastleInterface.h +++ b/client/windows/CCastleInterface.h @@ -173,7 +173,8 @@ public: void enterBank(); void enterToTheQuickRecruitmentWindow(); - void buildingClicked(BuildingID building, BuildingSubID::EBuildingSubID subID = BuildingSubID::NONE, BuildingID upgrades = BuildingID::NONE); + bool buildingTryActivateCustomUI(BuildingID buildingToTest, BuildingID buildingTarget); + void buildingClicked(BuildingID building); void addBuilding(BuildingID building); void removeBuilding(BuildingID building);//FIXME: not tested!!! }; diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index bc11501e7..c4e6815aa 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -946,7 +946,7 @@ void CUniversityWindow::CItem::hover(bool on) GH.statusbar()->clear(); } -CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, const IMarket * _market, const std::function & onWindowClosed) +CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, BuildingID building, const IMarket * _market, const std::function & onWindowClosed) : CWindowObject(PLAYER_COLORED, ImagePath::builtin("UNIVERS1")), hero(_hero), onWindowClosed(onWindowClosed), @@ -961,8 +961,7 @@ CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, const IMarket if(auto town = dynamic_cast(_market)) { auto faction = town->town->faction->getId(); - auto bid = town->town->getSpecialBuilding(BuildingSubID::MAGIC_UNIVERSITY)->bid; - titlePic = std::make_shared((*CGI->townh)[faction]->town->clientInfo.buildingsIcons, bid); + titlePic = std::make_shared((*CGI->townh)[faction]->town->clientInfo.buildingsIcons, building); } else if(auto uni = dynamic_cast(_market); uni->appearance) { diff --git a/client/windows/GUIClasses.h b/client/windows/GUIClasses.h index 00bf4c8fa..20d9f55e5 100644 --- a/client/windows/GUIClasses.h +++ b/client/windows/GUIClasses.h @@ -391,7 +391,7 @@ class CUniversityWindow final : public CStatusbarWindow, public IMarketHolder std::function onWindowClosed; public: - CUniversityWindow(const CGHeroInstance * _hero, const IMarket * _market, const std::function & onWindowClosed); + CUniversityWindow(const CGHeroInstance * _hero, BuildingID building, const IMarket * _market, const std::function & onWindowClosed); void makeDeal(SecondarySkill skill); void close() override; diff --git a/config/buildingsLibrary.json b/config/buildingsLibrary.json index eaa852df4..6397ffb98 100644 --- a/config/buildingsLibrary.json +++ b/config/buildingsLibrary.json @@ -48,7 +48,10 @@ "produce": { "gold": 4000 } }, - "marketplace": { "id" : 14 }, + "marketplace": { + "id" : 14, + "marketModes" : ["resource-resource", "resource-player"] + }, "resourceSilo": { "id" : 15, "requires" : [ "marketplace" ] }, "blacksmith": { "id" : 16 }, @@ -205,7 +208,26 @@ } }, - // Section 3 - buildings that now have dedicated mechanics + // Section 3 - markets + "artifactMerchant" : { + "requires" : [ "marketplace" ], + "marketModes" : ["resource-artifact", "artifact-resource"] + }, + + "freelancersGuild" : { + "requires" : [ "marketplace" ], + "marketModes" : ["creature-resource"] + }, + + "magicUniversity" : { + "marketModes" : ["resource-skill"] + }, + + "creatureTransformer" : { + "marketModes" : ["creature-undead"] + }, + + // Section 4 - buildings that now have dedicated mechanics "ballistaYard": { "blacksmith" : "ballista" }, diff --git a/config/factions/castle.json b/config/factions/castle.json index 38ab4c3a5..03b682cb2 100644 --- a/config/factions/castle.json +++ b/config/factions/castle.json @@ -165,7 +165,7 @@ "townHall": { }, "cityHall": { }, "capitol": { }, - "marketplace": { "marketModes" : ["resource-resource", "resource-player"] }, + "marketplace": { }, "resourceSilo": { "produce": { "ore": 1, "wood": 1 } }, "blacksmith": { "warMachine" : "ballista" }, diff --git a/config/factions/conflux.json b/config/factions/conflux.json index b38233c6a..a611b32c3 100644 --- a/config/factions/conflux.json +++ b/config/factions/conflux.json @@ -170,15 +170,15 @@ "townHall": { }, "cityHall": { }, "capitol": { }, - "marketplace": { "marketModes" : ["resource-resource", "resource-player"] }, + "marketplace": { }, "resourceSilo": { "produce": { "mercury": 1 } }, "blacksmith": { "warMachine" : "ballista" }, - "special1": { "type" : "artifactMerchant", "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] }, + "special1": { "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] }, "horde1": { "id" : 18, "upgrades" : "dwellingLvl1" }, "horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" }, "ship": { "id" : 20, "upgrades" : "shipyard" }, - "special2": { "type" : "magicUniversity", "requires" : [ "mageGuild1" ] }, + "special2": { "requires" : [ "mageGuild1" ], "marketModes" : ["resource-skill"] }, "grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 }}, "extraTownHall": { "id" : 27, "requires" : [ "townHall" ], "mode" : "auto" }, "extraCityHall": { "id" : 28, "requires" : [ "cityHall" ], "mode" : "auto" }, diff --git a/config/factions/dungeon.json b/config/factions/dungeon.json index a2ad35599..ef8d1b7e5 100644 --- a/config/factions/dungeon.json +++ b/config/factions/dungeon.json @@ -165,11 +165,11 @@ "townHall": { }, "cityHall": { }, "capitol": { }, - "marketplace": { "marketModes" : ["resource-resource", "resource-player"] }, + "marketplace": { }, "resourceSilo": { "produce": { "sulfur": 1 } }, "blacksmith": { "warMachine" : "ballista" }, - "special1": { "type" : "artifactMerchant", "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] }, + "special1": { "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] }, "horde1": { "id" : 18, "upgrades" : "dwellingLvl1" }, "horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" }, "special2": { diff --git a/config/factions/fortress.json b/config/factions/fortress.json index b1132c56a..62f3d1d51 100644 --- a/config/factions/fortress.json +++ b/config/factions/fortress.json @@ -164,7 +164,7 @@ "townHall": { }, "cityHall": { }, "capitol": { }, - "marketplace": { "marketModes" : ["resource-resource", "resource-player"] }, + "marketplace": { }, "resourceSilo": { "produce": { "wood": 1, "ore": 1 } }, "blacksmith": { "warMachine" : "firstAidTent" }, diff --git a/config/factions/inferno.json b/config/factions/inferno.json index 2fdcf8f56..04cd9dfc3 100644 --- a/config/factions/inferno.json +++ b/config/factions/inferno.json @@ -166,7 +166,7 @@ "townHall": { }, "cityHall": { }, "capitol": { }, - "marketplace": { "marketModes" : ["resource-resource", "resource-player"] }, + "marketplace": { }, "resourceSilo": { "produce": { "mercury": 1 } }, "blacksmith": { "warMachine" : "ammoCart" }, diff --git a/config/factions/necropolis.json b/config/factions/necropolis.json index a93f1e442..8485e092b 100644 --- a/config/factions/necropolis.json +++ b/config/factions/necropolis.json @@ -171,7 +171,7 @@ "townHall": { }, "cityHall": { }, "capitol": { }, - "marketplace": { "marketModes" : ["resource-resource", "resource-player"] }, + "marketplace": { }, "resourceSilo": { "produce": { "ore": 1, "wood": 1 } }, "blacksmith": { "warMachine" : "firstAidTent" }, @@ -181,7 +181,7 @@ "ship": { "id" : 20, "upgrades" : "shipyard" }, "special2": { "requires" : [ "mageGuild1" ], "bonuses": [ { "type": "UNDEAD_RAISE_PERCENTAGE", "val": 10, "propagator": "PLAYER_PROPAGATOR" } ] }, - "special3": { "type" : "creatureTransformer", "requires" : [ "dwellingLvl1" ], "marketModes" : ["creature-undead"] }, + "special3": { "requires" : [ "dwellingLvl1" ], "marketModes" : ["creature-undead"] }, "grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 }, "bonuses": [ { "type": "UNDEAD_RAISE_PERCENTAGE", "val": 20, "propagator": "PLAYER_PROPAGATOR" } ] }, diff --git a/config/factions/rampart.json b/config/factions/rampart.json index 2120a01ed..2b4c12f85 100644 --- a/config/factions/rampart.json +++ b/config/factions/rampart.json @@ -169,7 +169,7 @@ "townHall": { }, "cityHall": { }, "capitol": { }, - "marketplace": { "marketModes" : ["resource-resource", "resource-player"] }, + "marketplace": { }, "resourceSilo": { "produce": { "crystal": 1 } }, "blacksmith": { "warMachine" : "firstAidTent" }, diff --git a/config/factions/stronghold.json b/config/factions/stronghold.json index 01b5146ba..66af50a94 100644 --- a/config/factions/stronghold.json +++ b/config/factions/stronghold.json @@ -161,14 +161,14 @@ "townHall": { }, "cityHall": { }, "capitol": { }, - "marketplace": { "marketModes" : ["resource-resource", "resource-player"] }, + "marketplace": { }, "resourceSilo": { "produce": { "ore": 1, "wood": 1 } }, "blacksmith": { "warMachine" : "ammoCart" }, "special1": { "type" : "escapeTunnel", "requires" : [ "fort" ] }, "horde1": { "id" : 18, "upgrades" : "dwellingLvl1" }, "horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" }, - "special2": { "type" : "freelancersGuild", "requires" : [ "marketplace" ], "marketModes" : ["creature-resource"] }, + "special2": { "requires" : [ "marketplace" ], "marketModes" : ["creature-resource"] }, "special3": { "warMachine" : "ballista", "requires" : [ "blacksmith" ] }, "special4": { "requires" : [ "fort" ], diff --git a/config/factions/tower.json b/config/factions/tower.json index d2f660d7b..04741ba0d 100644 --- a/config/factions/tower.json +++ b/config/factions/tower.json @@ -164,11 +164,11 @@ "townHall": { }, "cityHall": { }, "capitol": { }, - "marketplace": { "marketModes" : ["resource-resource", "resource-player"] }, + "marketplace": { }, "resourceSilo": { "produce" : { "gems": 1 } }, "blacksmith": { "warMachine" : "ammoCart" }, - "special1": { "type" : "artifactMerchant", "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] }, + "special1": { "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] }, "horde1": { "id" : 18, "upgrades" : "dwellingLvl2" }, "horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl2", "requires" : [ "horde1" ], "mode" : "auto" }, "special2": { "height" : "high", "requires" : [ "fort" ] }, diff --git a/config/schemas/townBuilding.json b/config/schemas/townBuilding.json index e59a21bbe..d8ba32743 100644 --- a/config/schemas/townBuilding.json +++ b/config/schemas/townBuilding.json @@ -36,7 +36,7 @@ }, "type" : { "type" : "string", - "enum" : [ "mysticPond", "artifactMerchant", "freelancersGuild", "magicUniversity", "castleGate", "creatureTransformer", "portalOfSummoning", "library", "escapeTunnel", "treasury", "bank" ], + "enum" : [ "mysticPond", "castleGate", "portalOfSummoning", "library", "escapeTunnel", "treasury", "bank" ], "description" : "Subtype for some special buildings" }, "mode" : { @@ -104,7 +104,10 @@ }, "marketModes" : { "type" : "array", - "enum" : [ "resource-resource", "resource-player", "creature-resource", "resource-artifact", "artifact-resource", "artifact-experience", "creature-experience", "creature-undead", "resource-skill"], + "items" : { + "type" : "string", + "enum" : [ "resource-resource", "resource-player", "creature-resource", "resource-artifact", "artifact-resource", "artifact-experience", "creature-experience", "creature-undead", "resource-skill"], + }, "description" : "List of modes available in this market" } } diff --git a/lib/constants/Enumerations.h b/lib/constants/Enumerations.h index 2f871ad76..f9bcc5d2c 100644 --- a/lib/constants/Enumerations.h +++ b/lib/constants/Enumerations.h @@ -26,15 +26,10 @@ namespace BuildingSubID DEFAULT = -50, NONE = -1, CASTLE_GATE, - CREATURE_TRANSFORMER, MYSTIC_POND, - FOUNTAIN_OF_FORTUNE, - ARTIFACT_MERCHANT, LIBRARY, PORTAL_OF_SUMMONING, ESCAPE_TUNNEL, - FREELANCERS_GUILD, - MAGIC_UNIVERSITY, TREASURY, BANK }; diff --git a/lib/constants/StringConstants.h b/lib/constants/StringConstants.h index 415838b10..78fde625f 100644 --- a/lib/constants/StringConstants.h +++ b/lib/constants/StringConstants.h @@ -178,14 +178,9 @@ namespace MappedKeys static const std::map SPECIAL_BUILDINGS = { { "mysticPond", BuildingSubID::MYSTIC_POND }, - { "artifactMerchant", BuildingSubID::ARTIFACT_MERCHANT }, - { "freelancersGuild", BuildingSubID::FREELANCERS_GUILD }, - { "magicUniversity", BuildingSubID::MAGIC_UNIVERSITY }, { "castleGate", BuildingSubID::CASTLE_GATE }, - { "creatureTransformer", BuildingSubID::CREATURE_TRANSFORMER },//only skeleton transformer yet { "portalOfSummoning", BuildingSubID::PORTAL_OF_SUMMONING }, { "library", BuildingSubID::LIBRARY }, - { "fountainOfFortune", BuildingSubID::FOUNTAIN_OF_FORTUNE },//luck garrison bonus { "escapeTunnel", BuildingSubID::ESCAPE_TUNNEL }, { "treasury", BuildingSubID::TREASURY }, { "bank", BuildingSubID::BANK } diff --git a/lib/mapObjects/CGTownInstance.cpp b/lib/mapObjects/CGTownInstance.cpp index 4f2ab6cab..e2c88acb0 100644 --- a/lib/mapObjects/CGTownInstance.cpp +++ b/lib/mapObjects/CGTownInstance.cpp @@ -44,13 +44,10 @@ int CGTownInstance::getSightRadius() const //returns sight distance for(const auto & bid : builtBuildings) { - if(bid.IsSpecialOrGrail()) - { - auto height = town->buildings.at(bid)->height; - if(ret < height) - ret = height; + auto height = town->buildings.at(bid)->height; + if(ret < height) + ret = height; } -} return ret; }