1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Fixed CID 1288864

This commit is contained in:
AlexVinS 2016-11-26 22:06:12 +03:00
parent 96bc191480
commit 4b2bbd0d76

View File

@ -5274,12 +5274,14 @@ bool CGameHandler::sacrificeArtifact(const IMarket * m, const CGHeroInstance * h
ArtifactLocation al(hero, slot);
const CArtifactInstance *a = al.getArt();
if (!a)
COMPLAIN_RET("Cannot find artifact to sacrifice!");
COMPLAIN_RET_FALSE_IF(!a,"Cannot find artifact to sacrifice!");
int dmp, expToGive;
m->getOffer(hero->getArtTypeId(slot), 0, dmp, expToGive, EMarketMode::ARTIFACT_EXP);
auto typId = hero->getArtTypeId(slot);
COMPLAIN_RET_FALSE_IF(typId<0, "No artifact at position!");
m->getOffer(typId, 0, dmp, expToGive, EMarketMode::ARTIFACT_EXP);
removeArtifact(al);
changePrimSkill(hero, PrimarySkill::EXPERIENCE, expToGive);