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:
@ -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);
|
||||
|
Reference in New Issue
Block a user