|
@@ -1039,7 +1039,7 @@ void AIGateway::pickBestArtifacts(const CGHeroInstance * h, const CGHeroInstance
|
|
|
auto equipBest = [](const CGHeroInstance * h, const CGHeroInstance * otherh, bool giveStuffToFirstHero) -> void
|
|
|
{
|
|
|
bool changeMade = false;
|
|
|
- std::set<std::pair<CArtifactInstance *, CArtifactInstance *> > swappedSet;
|
|
|
+ std::set<std::pair<ArtifactInstanceID, ArtifactInstanceID> > swappedSet;
|
|
|
do
|
|
|
{
|
|
|
changeMade = false;
|
|
@@ -1120,13 +1120,13 @@ void AIGateway::pickBestArtifacts(const CGHeroInstance * h, const CGHeroInstance
|
|
|
//combined artifacts are not always allowed to move
|
|
|
if(artifactScore > otherArtifactScore && artifact->canBePutAt(target, slot, true))
|
|
|
{
|
|
|
- auto swapPair = std::minmax(artifact, otherSlot->artifact);
|
|
|
+ std::pair swapPair = std::minmax<ArtifactInstanceID>({artifact->getId(), otherSlot->artifactID});
|
|
|
if (swappedSet.find(swapPair) != swappedSet.end())
|
|
|
{
|
|
|
logAi->warn(
|
|
|
"Artifacts % s < -> % s have already swapped before, ignored.",
|
|
|
artifact->getType()->getJsonKey(),
|
|
|
- otherSlot->artifact->getType()->getJsonKey());
|
|
|
+ otherSlot->getArt()->getType()->getJsonKey());
|
|
|
continue;
|
|
|
}
|
|
|
logAi->trace(
|