Resolves an issue with mob avail options (#4651)

* Fixes #4647.
* Resolves an issue with mob avail options not properly checking the state of the option label.
Thanks to @Litro!
This commit is contained in:
Aleos
2020-02-17 20:30:05 -05:00
committed by GitHub
parent d165c19b73
commit b13bc7402c

View File

@@ -4621,9 +4621,10 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
}
if (this->nodeExists(node, "Options")) {
for (const auto &optionNode : node["Options"]) {
std::string option = optionNode.first.as<std::string>();
std::string option_constant = "OPTION_" + option;
const YAML::Node &optionNode = node["Options"];
for (const auto &it : optionNode) {
std::string option = it.first.as<std::string>(), option_constant = "OPTION_" + option;
int64 constant;
if (!script_get_constant(option_constant.c_str(), &constant)) {
@@ -4633,7 +4634,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
bool active;
if (!this->asBool(node, option, active))
if (!this->asBool(optionNode, option, active))
continue;
#ifdef NEW_CARTS