From b13bc7402c02f7315f87cc3bf3736cc3401bad68 Mon Sep 17 00:00:00 2001 From: Aleos Date: Mon, 17 Feb 2020 20:30:05 -0500 Subject: [PATCH] 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! --- src/map/mob.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 4b622a824a..f48c4d942d 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -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 option_constant = "OPTION_" + option; + const YAML::Node &optionNode = node["Options"]; + + for (const auto &it : optionNode) { + std::string option = it.first.as(), 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