1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Fix: VCAI should not attempt to move Spellbook

This commit is contained in:
Dmitry Orlov 2021-04-29 00:04:22 +03:00
parent 4063ab5894
commit 0e5d427dc9

View File

@ -1165,12 +1165,12 @@ void VCAI::pickBestArtifacts(const CGHeroInstance * h, const CGHeroInstance * ot
for(auto location : allArtifacts)
{
if(location.slot == ArtifactPosition::MACH4 || location.slot == ArtifactPosition::SPELLBOOK)
continue; // don't attempt to move catapult and spellbook
if(location.relatedObj() == target && location.slot < ArtifactPosition::AFTER_LAST)
continue; //don't reequip artifact we already wear
if(location.slot == ArtifactPosition::MACH4) // don't attempt to move catapult
continue;
auto s = location.getSlot();
if(!s || s->locked) //we can't move locks
continue;