From 8d58066f6900361289a0d0c813279bdd562f190d Mon Sep 17 00:00:00 2001 From: kdmcser Date: Sat, 9 Nov 2024 17:24:14 +0800 Subject: [PATCH] fix artifact sort by slot crash --- server/CGameHandler.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 7c47d88eb..696fd283b 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2773,11 +2773,7 @@ bool CGameHandler::manageBackpackArtifacts(const PlayerColor & player, const Obj makeSortBackpackRequest([](const ArtSlotInfo & inf) -> int32_t { auto possibleSlots = inf.getArt()->artType->getPossibleSlots(); - if (possibleSlots.find(ArtBearer::ALTAR) != possibleSlots.end() && !possibleSlots.at(ArtBearer::ALTAR).empty()) - { - return -3; - } - else if (possibleSlots.find(ArtBearer::CREATURE) != possibleSlots.end() && !possibleSlots.at(ArtBearer::CREATURE).empty()) + if (possibleSlots.find(ArtBearer::CREATURE) != possibleSlots.end() && !possibleSlots.at(ArtBearer::CREATURE).empty()) { return -2; } @@ -2792,7 +2788,7 @@ bool CGameHandler::manageBackpackArtifacts(const PlayerColor & player, const Obj else { logGlobal->error("Unable to get artifact %s slot.", inf.getArt()->artType->getNameTextID()); - return -4; + return -3; } }); }