1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

artifact utils

This commit is contained in:
SoundSSGood
2023-05-17 16:52:16 +03:00
parent 0a874cd89e
commit 021f94a579
22 changed files with 303 additions and 258 deletions

View File

@@ -14,6 +14,7 @@
#include "CMap.h"
#include "MapReaderH3M.h"
#include "../ArtifactUtils.h"
#include "../CCreatureHandler.h"
#include "../CGeneralTextHandler.h"
#include "../CHeroHandler.h"
@@ -864,7 +865,7 @@ 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 = CArtifactInstance::createArtifact(map, artifactID);
auto * artifact = ArtifactUtils::createArtifact(map, artifactID);
auto artifactPos = ArtifactPosition(slot);
if(artifact->canBePutAt(ArtifactLocation(hero, artifactPos)))
{
@@ -1111,7 +1112,7 @@ CGObjectInstance * CMapLoaderH3M::readArtifact(const int3 & mapPosition, std::sh
artID = ArtifactID(objectTemplate->subid);
}
object->storedArtifact = CArtifactInstance::createArtifact(map, artID, spellID);
object->storedArtifact = ArtifactUtils::createArtifact(map, artID, spellID);
return object;
}