1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Merge pull request #2874 from SoundSSGood/exchange-window-update

Exchange window update
This commit is contained in:
Ivan Savenko
2023-09-27 15:50:52 +03:00
committed by GitHub
35 changed files with 350 additions and 367 deletions

View File

@ -941,10 +941,10 @@ bool CMapLoaderH3M::loadArtifactToSlot(CGHeroInstance * hero, int slot)
// He has Shackles of War (normally - MISC slot artifact) in LEFT_HAND slot set in editor
// Artifact seems to be missing in game, so skip artifacts that don't fit target slot
auto * artifact = ArtifactUtils::createArtifact(map, artifactID);
auto artifactPos = ArtifactPosition(slot);
if(artifact->canBePutAt(ArtifactLocation(hero, artifactPos)))
auto dstLoc = ArtifactLocation(hero, ArtifactPosition(slot));
if(artifact->canBePutAt(dstLoc))
{
hero->putArtifact(artifactPos, artifact);
artifact->putAt(dstLoc);
}
else
{