mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Fix formatting of luck/morale bonuses
This commit is contained in:
parent
9e49587749
commit
7a42e21e4d
@ -294,7 +294,8 @@ void CArtifact::addNewBonus(const std::shared_ptr<Bonus>& b)
|
|||||||
{
|
{
|
||||||
b->source = BonusSource::ARTIFACT;
|
b->source = BonusSource::ARTIFACT;
|
||||||
b->duration = BonusDuration::PERMANENT;
|
b->duration = BonusDuration::PERMANENT;
|
||||||
b->description.appendName(id);
|
b->description.appendTextID(getNameTextID());
|
||||||
|
b->description.appendRawString(" %+d");
|
||||||
CBonusSystemNode::addNewBonus(b);
|
CBonusSystemNode::addNewBonus(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ void CSkill::addNewBonus(const std::shared_ptr<Bonus> & b, int level)
|
|||||||
b->sid = BonusSourceID(id);
|
b->sid = BonusSourceID(id);
|
||||||
b->duration = BonusDuration::PERMANENT;
|
b->duration = BonusDuration::PERMANENT;
|
||||||
b->description.appendTextID(getNameTextID());
|
b->description.appendTextID(getNameTextID());
|
||||||
|
b->description.appendRawString(" %+d");
|
||||||
levels[level-1].effects.push_back(b);
|
levels[level-1].effects.push_back(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,12 @@ DLL_LINKAGE std::string MetaString::toString() const
|
|||||||
break;
|
break;
|
||||||
case EMessage::REPLACE_POSITIVE_NUMBER:
|
case EMessage::REPLACE_POSITIVE_NUMBER:
|
||||||
if (dst.find("%+d") != std::string::npos)
|
if (dst.find("%+d") != std::string::npos)
|
||||||
boost::replace_first(dst, "%+d", '+' + std::to_string(numbers[nums++]));
|
{
|
||||||
|
if (numbers[nums] > 0)
|
||||||
|
boost::replace_first(dst, "%+d", '+' + std::to_string(numbers[nums++]));
|
||||||
|
else
|
||||||
|
boost::replace_first(dst, "%+d", std::to_string(numbers[nums++]));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
boost::replace_first(dst, "%d", std::to_string(numbers[nums++]));
|
boost::replace_first(dst, "%d", std::to_string(numbers[nums++]));
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user