diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index 1af854294..146403098 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -1378,7 +1378,7 @@ std::string CBuildWindow::getTextForState(int state) }; ret = CGI->generaltexth->allTexts[52]; - ret += "\n" + town->genBuildingRequirements(building->bid, false).toString(toStr); + ret += "\n" + town->genBuildingRequirements(building->bid).toString(toStr); break; } case EBuildingState::MISSING_BASE: diff --git a/launcher/modManager/cmodlistview_moc.cpp b/launcher/modManager/cmodlistview_moc.cpp index a6f3b22db..a85e1002d 100644 --- a/launcher/modManager/cmodlistview_moc.cpp +++ b/launcher/modManager/cmodlistview_moc.cpp @@ -74,6 +74,10 @@ CModListView::CModListView(QWidget *parent) : { loadRepositories(); } + else + { + manager->resetRepositories(); + } } void CModListView::loadRepositories() diff --git a/lib/mapObjects/CGTownInstance.cpp b/lib/mapObjects/CGTownInstance.cpp index a48173fcb..f15707f65 100644 --- a/lib/mapObjects/CGTownInstance.cpp +++ b/lib/mapObjects/CGTownInstance.cpp @@ -1126,7 +1126,7 @@ bool CGTownInstance::hasBuilt(BuildingID buildingID) const return vstd::contains(builtBuildings, buildingID); } -CBuilding::TRequired CGTownInstance::genBuildingRequirements(BuildingID buildID, bool includeUpgrade) const +CBuilding::TRequired CGTownInstance::genBuildingRequirements(BuildingID buildID) const { const CBuilding * building = town->buildings.at(buildID); @@ -1138,10 +1138,14 @@ CBuilding::TRequired CGTownInstance::genBuildingRequirements(BuildingID buildID, if (!hasBuilt(id)) return id; - if (build->upgrade != BuildingID::NONE && !hasBuilt(build->upgrade)) - return build->upgrade; + CBuilding::TRequired::OperatorAll requirements; - return build->requirements.morph(dependTest); + if (build->upgrade != BuildingID::NONE) + requirements.expressions.push_back(dependTest(build->upgrade)); + + requirements.expressions.push_back(build->requirements.morph(dependTest)); + + return requirements; }; CBuilding::TRequired::OperatorAll requirements; @@ -1149,9 +1153,7 @@ CBuilding::TRequired CGTownInstance::genBuildingRequirements(BuildingID buildID, { const CBuilding * upgr = town->buildings.at(building->upgrade); - if (includeUpgrade) - requirements.expressions.push_back(upgr->bid); - requirements.expressions.push_back(upgr->requirements.morph(dependTest)); + requirements.expressions.push_back(dependTest(upgr->bid)); } requirements.expressions.push_back(building->requirements.morph(dependTest)); diff --git a/lib/mapObjects/CGTownInstance.h b/lib/mapObjects/CGTownInstance.h index 34b781e84..620b37794 100644 --- a/lib/mapObjects/CGTownInstance.h +++ b/lib/mapObjects/CGTownInstance.h @@ -238,7 +238,7 @@ public: bool armedGarrison() const; //true if town has creatures in garrison or garrisoned hero int getTownLevel() const; - CBuilding::TRequired genBuildingRequirements(BuildingID build, bool includeUpgrade=true) const; + CBuilding::TRequired genBuildingRequirements(BuildingID build) const; void mergeGarrisonOnSiege() const; // merge garrison into army of visiting hero void removeCapitols (PlayerColor owner) const; diff --git a/lib/mapObjects/CRewardableObject.cpp b/lib/mapObjects/CRewardableObject.cpp index 698633d09..1c8163f4b 100644 --- a/lib/mapObjects/CRewardableObject.cpp +++ b/lib/mapObjects/CRewardableObject.cpp @@ -857,6 +857,7 @@ void CGOnceVisitable::initObj() info[0].reward.bonuses.push_back(bonus); info[1].reward.bonuses.push_back(bonus); info[0].message.addTxt(MetaString::ADVOB_TXT, 162); + info[0].message.addReplacement(VLC->arth->artifacts[info[0].reward.artifacts.back()]->Name()); info[1].message.addTxt(MetaString::ADVOB_TXT, 163); } break; diff --git a/lib/mapObjects/MiscObjects.cpp b/lib/mapObjects/MiscObjects.cpp index b1910f575..fd63509d0 100644 --- a/lib/mapObjects/MiscObjects.cpp +++ b/lib/mapObjects/MiscObjects.cpp @@ -1659,7 +1659,7 @@ std::string CGShrine::getHoverText(PlayerColor player) const std::string CGShrine::getHoverText(const CGHeroInstance * hero) const { std::string hoverName = getHoverText(hero->tempOwner); - if(vstd::contains(hero->spells, spell)) //hero knows that spell + if(wasVisited(hero->tempOwner) && vstd::contains(hero->spells, spell)) //know what spell there is and hero knows that spell hoverName += "\n\n" + VLC->generaltexth->allTexts[354]; // (Already learned) return hoverName; }