From 6ddf1a3224ef2298a0bc0920d14a9ffecd8fa967 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Thu, 27 May 2021 22:24:50 +0200 Subject: [PATCH] Fixed a few mistakes Thanks to @Everade --- src/map/mob.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 0a68a1c1bc..c9e341145b 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -4225,13 +4225,18 @@ bool MobDatabase::parseDropNode(const std::string& nodeName, const YAML::Node& n if( this->nodeExists( dropit, "Clear" ) ){ bool clear; - if( !this->asBool( node, "Clear", clear ) ){ + if( !this->asBool( dropit, "Clear", clear ) ){ return false; } if( clear ){ // Clear specific index drops[index] = {}; + + if( !this->nodeExists( dropit, "Item" ) ){ + // Continue with next yaml node + continue; + } } } } else { @@ -4245,7 +4250,7 @@ bool MobDatabase::parseDropNode(const std::string& nodeName, const YAML::Node& n if( this->nodeExists( dropit, "Clear" ) ){ bool clear; - if( !this->asBool( node, "Clear", clear ) ){ + if( !this->asBool( dropit, "Clear", clear ) ){ return false; } @@ -4255,7 +4260,7 @@ bool MobDatabase::parseDropNode(const std::string& nodeName, const YAML::Node& n drops[i] = {}; } - if( !this->nodeExists( node, "Item" ) ){ + if( !this->nodeExists( dropit, "Item" ) ){ // Continue with next yaml node continue; }