diff --git a/lib/CCreatureSet.cpp b/lib/CCreatureSet.cpp index c7798a5d5..61d8ea0ef 100644 --- a/lib/CCreatureSet.cpp +++ b/lib/CCreatureSet.cpp @@ -486,6 +486,8 @@ int CStackInstance::getQuantityID() const int CStackInstance::getExpRank() const { + if (!VLC->modh->modules.STACK_EXP) + return 0; int tier = type->level; if (vstd::iswithin(tier, 1, 7)) { diff --git a/lib/CModHandler.cpp b/lib/CModHandler.cpp index b29bff5b6..cc234ae29 100644 --- a/lib/CModHandler.cpp +++ b/lib/CModHandler.cpp @@ -159,11 +159,14 @@ CCreature * CModHandler::loadCreature (const JsonNode &node) BOOST_FOREACH (const JsonNode &bonus, node["abilities"].Vector()) { - cre->addNewBonus(ParseBonus(bonus)); + auto b = ParseBonus(bonus); + b->duration = Bonus::PERMANENT; + cre->addNewBonus(b); } BOOST_FOREACH (const JsonNode &exp, node["stackExperience"].Vector()) { auto bonus = ParseBonus (exp["bonus"]); + bonus->duration = Bonus::PERMANENT; const JsonVector &values = exp["values"].Vector(); int lowerLimit = 1, upperLimit = 255; if (values[0].getType() == JsonNode::JsonType::DATA_BOOL) @@ -172,7 +175,7 @@ CCreature * CModHandler::loadCreature (const JsonNode &node) { if (val.Bool() == true) { - bonus->limiter.reset (new RankRangeLimiter(lowerLimit)); + bonus->limiter = make_shared(RankRangeLimiter(lowerLimit)); cre->addNewBonus (new Bonus(*bonus)); //bonuses must be unique objects break; //TODO: allow bonuses to turn off? }