mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fixes crash on dropping an artifact on an empty garrison slot;
This commit is contained in:
@@ -239,6 +239,8 @@ void CGarrisonSlot::clickLeft(tribool down, bool previousState)
|
||||
{
|
||||
const CGHeroInstance *srcHero = commonInfo->src.AOH->getHero();
|
||||
artSelected = true;
|
||||
if (myStack) // try dropping the artifact only if the slot isn't empty
|
||||
{
|
||||
ArtifactLocation src(srcHero, commonInfo->src.slotID);
|
||||
ArtifactLocation dst(myStack, ArtifactPosition::CREATURE_SLOT);
|
||||
if (art->canBePutAt(dst, true))
|
||||
@@ -253,6 +255,7 @@ void CGarrisonSlot::clickLeft(tribool down, bool previousState)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!artSelected && creature)
|
||||
{
|
||||
owner->selectSlot(this);
|
||||
|
||||
Reference in New Issue
Block a user