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

Merge pull request #3010 from SoundSSGood/arts-placement-fix

This commit is contained in:
Nordsoft91 2023-10-08 12:11:20 +02:00 committed by GitHub
commit e41c767653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1136,10 +1136,13 @@ void CArtifactSet::serializeJsonHero(JsonSerializeFormat & handler, CMap * map)
{ {
for(const ArtifactID & artifactID : backpackTemp) for(const ArtifactID & artifactID : backpackTemp)
{ {
auto * artifact = ArtifactUtils::createArtifact(map, artifactID.toEnum()); auto * artifact = ArtifactUtils::createArtifact(map, artifactID);
auto slot = ArtifactPosition::BACKPACK_START + (si32)artifactsInBackpack.size(); auto slot = ArtifactPosition::BACKPACK_START + artifactsInBackpack.size();
if(artifact->artType->canBePutAt(this, slot)) if(artifact->artType->canBePutAt(this, slot))
putArtifact(slot, artifact); {
auto artsMap = putArtifact(slot, artifact);
artifact->addPlacementMap(artsMap);
}
} }
} }
} }
@ -1178,7 +1181,8 @@ void CArtifactSet::serializeJsonSlot(JsonSerializeFormat & handler, const Artifa
if(artifact->artType->canBePutAt(this, slot)) if(artifact->artType->canBePutAt(this, slot))
{ {
putArtifact(slot, artifact); auto artsMap = putArtifact(slot, artifact);
artifact->addPlacementMap(artsMap);
} }
else else
{ {