mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Merge pull request #2874 from SoundSSGood/exchange-window-update
Exchange window update
This commit is contained in:
@@ -492,7 +492,7 @@ void CMap::checkForObjectives()
|
||||
}
|
||||
}
|
||||
|
||||
void CMap::addNewArtifactInstance(CArtifactInstance * art)
|
||||
void CMap::addNewArtifactInstance(ConstTransitivePtr<CArtifactInstance> art)
|
||||
{
|
||||
art->setId(static_cast<ArtifactInstanceID>(artInstances.size()));
|
||||
artInstances.emplace_back(art);
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
void removeBlockVisTiles(CGObjectInstance * obj, bool total = false);
|
||||
void calculateGuardingGreaturePositions();
|
||||
|
||||
void addNewArtifactInstance(CArtifactInstance * art);
|
||||
void addNewArtifactInstance(ConstTransitivePtr<CArtifactInstance> art);
|
||||
void eraseArtifactInstance(CArtifactInstance * art);
|
||||
|
||||
void addNewQuestInstance(CQuest * quest);
|
||||
|
||||
@@ -941,10 +941,10 @@ bool CMapLoaderH3M::loadArtifactToSlot(CGHeroInstance * hero, int slot)
|
||||
// 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(map, artifactID);
|
||||
auto artifactPos = ArtifactPosition(slot);
|
||||
if(artifact->canBePutAt(ArtifactLocation(hero, artifactPos)))
|
||||
auto dstLoc = ArtifactLocation(hero, ArtifactPosition(slot));
|
||||
if(artifact->canBePutAt(dstLoc))
|
||||
{
|
||||
hero->putArtifact(artifactPos, artifact);
|
||||
artifact->putAt(dstLoc);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user