mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Attempt to fix crash on rewardable configuration
This commit is contained in:
@@ -272,18 +272,18 @@ void Rewardable::Info::replaceTextPlaceholders(MetaString & target, const Variab
|
||||
|
||||
void Rewardable::Info::configureRewards(
|
||||
Rewardable::Configuration & object,
|
||||
CRandomGenerator & rng, const
|
||||
JsonNode & source,
|
||||
CRandomGenerator & rng,
|
||||
const JsonNode & source,
|
||||
Rewardable::EEventType event,
|
||||
const std::string & modeName) const
|
||||
{
|
||||
for(size_t i = 0; i < source.Vector().size(); ++i)
|
||||
{
|
||||
const JsonNode reward = source.Vector()[i];
|
||||
const JsonNode & reward = source.Vector().at(i);
|
||||
|
||||
if (!reward["appearChance"].isNull())
|
||||
{
|
||||
JsonNode chance = reward["appearChance"];
|
||||
const JsonNode & chance = reward["appearChance"];
|
||||
std::string diceID = std::to_string(chance["dice"].Integer());
|
||||
|
||||
auto diceValue = object.getVariable("dice", diceID);
|
||||
|
||||
Reference in New Issue
Block a user