From 21a482f573f33fd7137079d4264e3d9a4c3d51ce Mon Sep 17 00:00:00 2001 From: Emistry Haoyan Date: Sat, 7 Mar 2020 21:48:50 +0800 Subject: [PATCH] Validate duplicated item_db entries - encourage usage of `inherit` field. - able to detect duplicated items where inherit field aren't used. --- src/map/itemdb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 2b8200c0621..130a1211436 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -2033,6 +2033,10 @@ static int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const } } + if (itemdb->exists(id.nameid) && inherit == false) { + ShowWarning("itemdb_readdb_libconfig_sub: Duplicated item %d found in \"%s\".\n", id.nameid, source); + } + if( !libconfig->setting_lookup_string(it, "AegisName", &str) || !*str ) { if( !inherit ) { ShowWarning("itemdb_readdb_libconfig_sub: Missing AegisName in item %d of \"%s\", skipping.\n", id.nameid, source);