1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Remove more subID access

This commit is contained in:
Ivan Savenko
2023-10-28 12:27:10 +03:00
parent 5cdbf408c7
commit 8346d71c98
33 changed files with 92 additions and 90 deletions

View File

@@ -2315,7 +2315,7 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID,
auto isLibrary = isMageGuild ? false
: t->town->buildings.at(buildingID)->subId == BuildingSubID::EBuildingSubID::LIBRARY;
if(isMageGuild || isLibrary || (t->subID == ETownType::CONFLUX && buildingID == BuildingID::GRAIL))
if(isMageGuild || isLibrary || (t->getFaction() == ETownType::CONFLUX && buildingID == BuildingID::GRAIL))
{
if(t->visitingHero)
giveSpells(t,t->visitingHero);
@@ -3284,7 +3284,7 @@ void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n)
if (!town->hasBuilt(i))
{
buildStructure(town->id, i, true);
iw.components.emplace_back(Component::EComponentType::BUILDING, town->subID, i, 0);
iw.components.emplace_back(Component::EComponentType::BUILDING, town->getFaction(), i, 0);
}
}
@@ -3430,7 +3430,7 @@ void CGameHandler::objectVisited(const CGObjectInstance * obj, const CGHeroInsta
{
using events::ObjectVisitStarted;
logGlobal->debug("%s visits %s (%d:%d)", h->nodeName(), obj->getObjectName(), obj->ID, obj->subID);
logGlobal->debug("%s visits %s (%d)", h->nodeName(), obj->getObjectName(), obj->ID);
if (getVisitingHero(obj) != nullptr)
{