diff --git a/src/map/map.c b/src/map/map.c index 6e8a3d074b9..edd062aa80b 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -7028,7 +7028,6 @@ int do_init(int argc, char *argv[]) atcommand->msg_read(map->MSG_CONF_NAME, false); map->inter_config_read(map->INTER_CONF_NAME, false); logs->config_read(map->LOG_CONF_NAME, false); - storage->config_read(map->STORAGE_CONF_FILENAME, false); } else { battle->config_read(map->BATTLE_CONF_FILENAME, false); } diff --git a/src/map/storage.c b/src/map/storage.c index c676f64df75..141a24bcacc 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -1009,7 +1009,7 @@ bool storage_config_read(const char *filename, bool imported) nullpo_retr(false, filename); if (!imported) - VECTOR_INIT(storage->configuration); + VECTOR_CLEAR(storage->configuration); struct config_t stor_libconf; if (libconfig->load_file(&stor_libconf, filename) == CONFIG_FALSE) @@ -1035,11 +1035,13 @@ bool storage_config_read(const char *filename, bool imported) } // Duplicate ID search and report... - int d = 0; - ARR_FIND(0, VECTOR_LENGTH(storage->configuration), d, VECTOR_INDEX(storage->configuration, d).uid == s_conf.uid); - if (d < VECTOR_LENGTH(storage->configuration)) { - ShowError("storage_config_read: Duplicate ID %d for storage. Skipping...\n", s_conf.uid); - continue; + if (!imported) { + int d = 0; + ARR_FIND(0, VECTOR_LENGTH(storage->configuration), d, VECTOR_INDEX(storage->configuration, d).uid == s_conf.uid); + if (d < VECTOR_LENGTH(storage->configuration)) { + ShowError("storage_config_read: Duplicate ID %d for storage. Skipping...\n", s_conf.uid); + continue; + } } // Check for an invalid ID... @@ -1117,6 +1119,8 @@ static void do_init_storage(bool minimal) { if (minimal) return; + VECTOR_INIT(storage->configuration); + storage->config_read(map->STORAGE_CONF_FILENAME, false); } /**