1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Regression fixed

This commit is contained in:
SoundSSGood 2023-02-13 12:56:23 +02:00
parent 8504102c53
commit 0f93b0991c
3 changed files with 9 additions and 5 deletions

View File

@ -294,8 +294,9 @@ void BulkMoveArtifacts::applyCl(CClient * cl)
{
auto srcLoc = ArtifactLocation(srcArtHolder, slotToMove.srcPos);
auto dstLoc = ArtifactLocation(dstArtHolder, slotToMove.dstPos);
MoveArtifact ma(&srcLoc, &dstLoc, false);
ma.applyCl(cl);
callInterfaceIfPresent(cl, srcLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc);
if(srcLoc.owningPlayer() != dstLoc.owningPlayer())
callInterfaceIfPresent(cl, dstLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc);
}
};

View File

@ -752,9 +752,10 @@ void CArtifactsOfHero::artifactMoved(const ArtifactLocation & src, const Artifac
assert(commonInfo->src.AOH);
CCS->curh->dragAndDropCursor("artifact", dst.getArt()->artType->getIconIndex());
}
auto art = dst.getArt();
if(art && dst.slot == ArtifactPosition::TRANSITION_POS)
markPossibleSlots(art);
if(!curHero->artifactsTransitionPos.empty())
{
markPossibleSlots(curHero->getArt(ArtifactPosition::TRANSITION_POS));
}
}
updateParentWindow();

View File

@ -1027,6 +1027,8 @@ bool CCombinedArtifactInstance::canBePutAt(const CArtifactSet * artSet, Artifact
{
if(slot == ArtifactPosition::TRANSITION_POS)
return true;
if(!CArtifactInstance::canBePutAt(artSet, slot, assumeDestRemoved))
return false;
if(ArtifactUtils::isSlotBackpack(slot))
return true; //we can always remove combined art to the backapck