1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Rename town building types to more clear names

This commit is contained in:
Ivan Savenko
2024-08-16 14:49:42 +00:00
parent abfb467f68
commit 2f3f3c21df
9 changed files with 111 additions and 159 deletions

View File

@@ -36,7 +36,7 @@
#include "mapObjects/CBank.h"
#include "mapObjects/CGCreature.h"
#include "mapObjects/CGMarket.h"
#include "mapObjects/CGTownBuilding.h"
#include "mapObjects/TownBuildingInstance.h"
#include "mapObjects/CGTownInstance.h"
#include "mapObjects/CQuest.h"
#include "mapObjects/MiscObjects.h"
@@ -1333,18 +1333,8 @@ void NewStructures::applyGs(CGameState *gs)
{
assert(t->town->buildings.at(id) != nullptr);
t->builtBuildings.insert(id);
t->updateAppearance();
auto currentBuilding = t->town->buildings.at(id);
if(currentBuilding->overrideBids.empty())
continue;
for(const auto & overrideBid : currentBuilding->overrideBids)
{
t->overriddenBuildings.insert(overrideBid);
t->deleteTownBonus(overrideBid);
}
}
t->updateAppearance();
t->built = built;
t->recreateBuildingsBonuses();
}
@@ -2442,13 +2432,13 @@ void SetRewardableConfiguration::applyGs(CGameState * gs)
else
{
auto * townPtr = dynamic_cast<CGTownInstance*>(objectPtr);
CGTownBuilding * buildingPtr = nullptr;
TownBuildingInstance * buildingPtr = nullptr;
for (CGTownBuilding * building : townPtr->bonusingBuildings)
if (building->getBuildingType() == buildingID)
buildingPtr = building;
for (auto & building : townPtr->rewardableBuildings)
if (building.second->getBuildingType() == buildingID)
buildingPtr = building.second;
auto * rewardablePtr = dynamic_cast<CTownRewardableBuilding *>(buildingPtr);
auto * rewardablePtr = dynamic_cast<TownRewardableBuildingInstance *>(buildingPtr);
assert(rewardablePtr);
rewardablePtr->configuration = configuration;
}