mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
some refactoring
This commit is contained in:
parent
7314df56ac
commit
2976739c97
@ -294,9 +294,8 @@ void BulkMoveArtifacts::applyCl(CClient * cl)
|
||||
{
|
||||
auto srcLoc = ArtifactLocation(srcArtHolder, slotToMove.srcPos);
|
||||
auto dstLoc = ArtifactLocation(dstArtHolder, slotToMove.dstPos);
|
||||
callInterfaceIfPresent(cl, srcLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc);
|
||||
if(srcLoc.owningPlayer() != dstLoc.owningPlayer())
|
||||
callInterfaceIfPresent(cl, dstLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc);
|
||||
MoveArtifact ma(&srcLoc, &dstLoc, false);
|
||||
ma.applyCl(cl);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1032,13 +1032,13 @@ bool CCombinedArtifactInstance::canBePutAt(const CArtifactSet * artSet, Artifact
|
||||
|
||||
CArtifactFittingSet fittingSet(artSet->bearerType());
|
||||
fittingSet.artifactsWorn = artSet->artifactsWorn;
|
||||
auto removedArt = fittingSet.getArt(slot);
|
||||
if(assumeDestRemoved && removedArt)
|
||||
auto artToRemove = fittingSet.getArt(slot);
|
||||
if(assumeDestRemoved && artToRemove)
|
||||
{
|
||||
if(removedArt->canBeDisassembled())
|
||||
if(artToRemove->canBeDisassembled())
|
||||
{
|
||||
auto contitutient = dynamic_cast<CCombinedArtifactInstance*>(removedArt);
|
||||
for(auto & part : contitutient->constituentsInfo)
|
||||
auto combinedArtToRemove = dynamic_cast<CCombinedArtifactInstance*>(artToRemove);
|
||||
for(auto & part : combinedArtToRemove->constituentsInfo)
|
||||
{
|
||||
if(ArtifactUtils::isSlotEquipment(part.slot))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user