Sfoglia il codice sorgente

First small follow up to 04cfe17

Only report duplicate Aegisname, if it is not the same item.
When buy and sell price caused a possible zeny exploit the whole YAML node will be reported, since it could be from import and either Buy or Sell might not exist.
Lemongrass3110 4 anni fa
parent
commit
63e42dbd4b
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      src/map/itemdb.cpp

+ 4 - 2
src/map/itemdb.cpp

@@ -67,7 +67,9 @@ uint64 ItemDatabase::parseBodyNode(const YAML::Node &node) {
 		if (!this->asString(node, "AegisName", name))
 			return 0;
 
-		if (itemdb_search_aegisname(name.c_str())) {
+		item_data* id = itemdb_search_aegisname(name.c_str());
+
+		if (id != nullptr && id->nameid != nameid) {
 			this->invalidWarning(node["AegisName"], "Found duplicate item Aegis name for %s, skipping.\n", name.c_str());
 			return 0;
 		}
@@ -180,7 +182,7 @@ uint64 ItemDatabase::parseBodyNode(const YAML::Node &node) {
 	}
 
 	if (item->value_buy / 124. < item->value_sell / 75.) {
-		this->invalidWarning(node["Sell"], "Buying/Selling [%d/%d] price of %s (%hu) allows Zeny making exploit through buying/selling at discounted/overcharged prices! Defaulting Sell to 1 Zeny.\n", item->value_buy, item->value_sell, item->name.c_str(), nameid);
+		this->invalidWarning(node, "Buying/Selling [%d/%d] price of %s (%hu) allows Zeny making exploit through buying/selling at discounted/overcharged prices! Defaulting Sell to 1 Zeny.\n", item->value_buy, item->value_sell, item->name.c_str(), nameid);
 		item->value_sell = 1;
 	}