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:
parent
96bc191480
commit
4b2bbd0d76
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user