1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Merge remote-tracking branch 'origin/develop' into ban_stuff_on_water_maps

This commit is contained in:
Tomasz Zieliński
2023-07-19 12:05:30 +02:00
41 changed files with 588 additions and 72 deletions

View File

@@ -136,7 +136,7 @@ MapFormatFeaturesH3M MapFormatFeaturesH3M::getFeaturesHOTA(uint32_t hotaVersion)
{
result.artifactsCount = 163; // + HotA artifacts
result.heroesCount = 178; // + Cove
result.heroesPortraitsCount = 185; // + Cove
result.heroesPortraitsCount = 186; // + Cove
}
if(hotaVersion == 3)
{

View File

@@ -1737,7 +1737,7 @@ CGObjectInstance * CMapLoaderH3M::readHero(const int3 & mapPosition, const Objec
if(!object->spells.empty())
{
object->clear();
logGlobal->warn("Hero %s subID=%d has spells set twice (in map properties and on adventure map instance). Using the latter set...", object->getNameTextID(), object->subID);
logGlobal->debug("Hero %s subID=%d has spells set twice (in map properties and on adventure map instance). Using the latter set...", object->getNameTextID(), object->subID);
}
object->spells.insert(SpellID::PRESET); //placeholder "preset spells"

View File

@@ -29,7 +29,7 @@ void MapIdentifiersH3M::loadMapping(std::map<IdentifierID, IdentifierID> & resul
for (auto entry : mapping.Struct())
{
IdentifierID sourceID (entry.second.Integer());
IdentifierID targetID (*VLC->modh->identifiers.getIdentifier(VLC->modh->scopeGame(), identifierName, entry.first));
IdentifierID targetID (*VLC->modh->identifiers.getIdentifier(entry.second.meta, identifierName, entry.first));
result[sourceID] = targetID;
}
@@ -39,13 +39,13 @@ void MapIdentifiersH3M::loadMapping(const JsonNode & mapping)
{
for (auto entryFaction : mapping["buildings"].Struct())
{
FactionID factionID (*VLC->modh->identifiers.getIdentifier(VLC->modh->scopeGame(), "faction", entryFaction.first));
FactionID factionID (*VLC->modh->identifiers.getIdentifier(entryFaction.second.meta, "faction", entryFaction.first));
auto buildingMap = entryFaction.second;
for (auto entryBuilding : buildingMap.Struct())
{
BuildingID sourceID (entryBuilding.second.Integer());
BuildingID targetID (*VLC->modh->identifiers.getIdentifier(VLC->modh->scopeGame(), "building." + VLC->factions()->getById(factionID)->getJsonKey(), entryBuilding.first));
BuildingID targetID (*VLC->modh->identifiers.getIdentifier(entryBuilding.second.meta, "building." + VLC->factions()->getById(factionID)->getJsonKey(), entryBuilding.first));
mappingFactionBuilding[factionID][sourceID] = targetID;
}
@@ -68,7 +68,7 @@ void MapIdentifiersH3M::loadMapping(const JsonNode & mapping)
{
for (auto entryInner : entryOuter.second.Struct())
{
auto handler = VLC->objtypeh->getHandlerFor( VLC->modh->scopeGame(), entryOuter.first, entryInner.first);
auto handler = VLC->objtypeh->getHandlerFor( entryInner.second.meta, entryOuter.first, entryInner.first);
auto entryValues = entryInner.second.Vector();
ObjectTypeIdentifier h3mID{Obj(entryValues[0].Integer()), int32_t(entryValues[1].Integer())};
@@ -78,7 +78,7 @@ void MapIdentifiersH3M::loadMapping(const JsonNode & mapping)
}
else
{
auto handler = VLC->objtypeh->getHandlerFor( VLC->modh->scopeGame(), entryOuter.first, entryOuter.first);
auto handler = VLC->objtypeh->getHandlerFor( entryOuter.second.meta, entryOuter.first, entryOuter.first);
auto entryValues = entryOuter.second.Vector();
ObjectTypeIdentifier h3mID{Obj(entryValues[0].Integer()), int32_t(entryValues[1].Integer())};
@@ -90,7 +90,7 @@ void MapIdentifiersH3M::loadMapping(const JsonNode & mapping)
for (auto entry : mapping["portraits"].Struct())
{
int32_t sourceID = entry.second.Integer();
int32_t targetID = *VLC->modh->identifiers.getIdentifier(VLC->modh->scopeGame(), "hero", entry.first);
int32_t targetID = *VLC->modh->identifiers.getIdentifier(entry.second.meta, "hero", entry.first);
int32_t iconID = VLC->heroTypes()->getByIndex(targetID)->getIconIndex();
mappingHeroPortrait[sourceID] = iconID;