1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

MoraleLuckBox: handle BLOCK_LUCK bonus. Fix issue 2130

This commit is contained in:
Arseniy Shestakov 2015-12-24 22:35:32 +03:00
parent 6f5c52a229
commit 8eb4f14ff0

View File

@ -380,7 +380,16 @@ void MoraleLuckBox::set(const IBonusBearer *node)
if (morale && node && (node->hasBonusOfType(Bonus::UNDEAD) if (morale && node && (node->hasBonusOfType(Bonus::UNDEAD)
|| node->hasBonusOfType(Bonus::BLOCK_MORALE) || node->hasBonusOfType(Bonus::BLOCK_MORALE)
|| node->hasBonusOfType(Bonus::NON_LIVING))) || node->hasBonusOfType(Bonus::NON_LIVING)))
text += CGI->generaltexth->arraytxt[113]; //unaffected by morale {
text += CGI->generaltexth->arraytxt[113]; //unaffected by morale
bonusValue = 0;
}
else if(!morale && node && node->hasBonusOfType(Bonus::BLOCK_LUCK))
{
// TODO: there is no text like "Unaffected by luck" so probably we need own text
text += CGI->generaltexth->arraytxt[noneTxtId];
bonusValue = 0;
}
else if(modifierList->empty()) else if(modifierList->empty())
text += CGI->generaltexth->arraytxt[noneTxtId];//no modifiers text += CGI->generaltexth->arraytxt[noneTxtId];//no modifiers
else else