Browse Source

Fixed a few mistakes

Thanks to @Everade
Lemongrass3110 4 năm trước cách đây
mục cha
commit
6ddf1a3224
1 tập tin đã thay đổi với 8 bổ sung3 xóa
  1. 8 3
      src/map/mob.cpp

+ 8 - 3
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;
 					}