mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-09 13:14:02 +02:00
Fix hero level limiter
This commit is contained in:
parent
3199b7261f
commit
74a90cde5d
@ -60,7 +60,7 @@ static std::string visitedTxt(const bool visited)
|
|||||||
|
|
||||||
const std::string & CQuest::missionName(int mission)
|
const std::string & CQuest::missionName(int mission)
|
||||||
{
|
{
|
||||||
static const std::array<std::string, 14> names = {
|
static const std::array<std::string, 11> names = {
|
||||||
"empty",
|
"empty",
|
||||||
"heroLevel",
|
"heroLevel",
|
||||||
"primarySkill",
|
"primarySkill",
|
||||||
@ -351,7 +351,7 @@ void CQuest::serializeJson(JsonSerializeFormat & handler, const std::string & fi
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(missionType == "Level")
|
if(missionType == "Level")
|
||||||
handler.serializeInt("heroLevel", mission.heroLevel, -1);
|
handler.serializeInt("heroLevel", mission.heroLevel);
|
||||||
|
|
||||||
if(missionType == "PrimaryStat")
|
if(missionType == "PrimaryStat")
|
||||||
{
|
{
|
||||||
|
@ -179,7 +179,7 @@ void Rewardable::Limiter::loadComponents(std::vector<Component> & comps,
|
|||||||
if (heroExperience)
|
if (heroExperience)
|
||||||
comps.emplace_back(Component::EComponentType::EXPERIENCE, 0, static_cast<si32>(h->calculateXp(heroExperience)), 0);
|
comps.emplace_back(Component::EComponentType::EXPERIENCE, 0, static_cast<si32>(h->calculateXp(heroExperience)), 0);
|
||||||
|
|
||||||
if (heroLevel)
|
if (heroLevel > 0)
|
||||||
comps.emplace_back(Component::EComponentType::EXPERIENCE, 1, heroLevel, 0);
|
comps.emplace_back(Component::EComponentType::EXPERIENCE, 1, heroLevel, 0);
|
||||||
|
|
||||||
if (manaPoints || manaPercentage > 0)
|
if (manaPoints || manaPercentage > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user