1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-02 00:10:22 +02:00

fix artifact sort by slot crash

This commit is contained in:
kdmcser 2024-11-09 17:24:14 +08:00
parent 17dd8ffb48
commit 8d58066f69

View File

@ -2773,11 +2773,7 @@ bool CGameHandler::manageBackpackArtifacts(const PlayerColor & player, const Obj
makeSortBackpackRequest([](const ArtSlotInfo & inf) -> int32_t makeSortBackpackRequest([](const ArtSlotInfo & inf) -> int32_t
{ {
auto possibleSlots = inf.getArt()->artType->getPossibleSlots(); auto possibleSlots = inf.getArt()->artType->getPossibleSlots();
if (possibleSlots.find(ArtBearer::ALTAR) != possibleSlots.end() && !possibleSlots.at(ArtBearer::ALTAR).empty()) if (possibleSlots.find(ArtBearer::CREATURE) != possibleSlots.end() && !possibleSlots.at(ArtBearer::CREATURE).empty())
{
return -3;
}
else if (possibleSlots.find(ArtBearer::CREATURE) != possibleSlots.end() && !possibleSlots.at(ArtBearer::CREATURE).empty())
{ {
return -2; return -2;
} }
@ -2792,7 +2788,7 @@ bool CGameHandler::manageBackpackArtifacts(const PlayerColor & player, const Obj
else else
{ {
logGlobal->error("Unable to get artifact %s slot.", inf.getArt()->artType->getNameTextID()); logGlobal->error("Unable to get artifact %s slot.", inf.getArt()->artType->getNameTextID());
return -4; return -3;
} }
}); });
} }