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

IMarket now able to store artifacts

This commit is contained in:
SoundSSGood
2024-08-16 18:00:02 +03:00
parent fd45b5144d
commit 39bb6d5f39
14 changed files with 123 additions and 74 deletions

View File

@@ -2198,18 +2198,20 @@ CGObjectInstance * CMapLoaderH3M::readTown(const int3 & position, std::shared_pt
bool hasCustomBuildings = reader->readBool();
if(hasCustomBuildings)
{
reader->readBitmaskBuildings(object->builtBuildings, faction);
reader->readBitmaskBuildings(object->forbiddenBuildings, faction);
object->subID = faction.value();
for(const auto & building : reader->readBitmaskBuildings(faction))
object->addBuilding(building);
object->forbiddenBuildings = reader->readBitmaskBuildings(faction);
}
// Standard buildings
else
{
bool hasFort = reader->readBool();
if(hasFort)
object->builtBuildings.insert(BuildingID::FORT);
object->addBuilding(BuildingID::FORT);
//means that set of standard building should be included
object->builtBuildings.insert(BuildingID::DEFAULT);
object->addBuilding(BuildingID::DEFAULT);
}
if(features.levelAB)
@@ -2257,7 +2259,7 @@ CGObjectInstance * CMapLoaderH3M::readTown(const int3 & position, std::shared_pt
reader->skipZero(17);
// New buildings
reader->readBitmaskBuildings(event.buildings, faction);
event.buildings = reader->readBitmaskBuildings(faction);
event.creatures.resize(7);
for(int i = 0; i < 7; ++i)