1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Workaround for serializer allowing sending CStackInstance* pointing to commander. (and only CStackInstance*)

This commit is contained in:
Michał W. Urbańczyk
2012-05-21 23:39:35 +00:00
parent d34cf90bf7
commit 401d6816d1
2 changed files with 32 additions and 4 deletions

View File

@ -1030,7 +1030,15 @@ bool CArtifactInstance::canBePutAt(const CArtifactSet *artSet, int slot, bool as
return true;
}
if(!vstd::contains(artType->possibleSlots[artSet->bearerType()], slot))
auto possibleSlots = artType->possibleSlots.find(artSet->bearerType());
if(possibleSlots == artType->possibleSlots.end())
{
tlog3 << "Warning: arrtifact " << artType->Name() << " doesn't have defined allowed slots for bearer of type "
<< artSet->bearerType() << std::endl;
return false;
}
if(!vstd::contains(possibleSlots->second, slot))
return false;
return artSet->isPositionFree(slot, assumeDestRemoved);