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

vcmiscrolls

This commit is contained in:
SoundSSGood
2024-09-04 20:39:13 +03:00
parent 30fa2846aa
commit 7466d7452d
16 changed files with 78 additions and 52 deletions

View File

@@ -954,15 +954,15 @@ bool CMapLoaderH3M::loadArtifactToSlot(CGHeroInstance * hero, int slot)
// H3 bug workaround - Enemy hero on 3rd scenario of Good1.h3c campaign ("Long Live The Queen")
// 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(artifactID);
if(artifact->canBePutAt(hero, ArtifactPosition(slot)))
if(ArtifactID(artifactID).toArtifact()->canBePutAt(hero, ArtifactPosition(slot)))
{
auto * artifact = ArtifactUtils::createArtifact(artifactID);
artifact->putAt(*hero, ArtifactPosition(slot));
map->addNewArtifactInstance(artifact);
}
else
{
logGlobal->warn("Map '%s': Artifact '%s' can't be put at the slot %d", mapName, artifact->artType->getNameTranslated(), slot);
logGlobal->warn("Map '%s': Artifact '%s' can't be put at the slot %d", mapName, ArtifactID(artifactID).toArtifact()->getNameTranslated(), slot);
return false;
}