diff options
author | Haru <haru@dotalux.com> | 2016-09-18 01:14:24 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-09-18 01:43:19 +0200 |
commit | ebecc72d189d931d1b5d8269afd0e89c8ac73c3d (patch) | |
tree | 092392987c55369698e319c9da135404155bf0aa /src/map | |
parent | fc9b897f73fd94afb1ab2c57fe05e9f541136800 (diff) | |
download | hercules-ebecc72d189d931d1b5d8269afd0e89c8ac73c3d.tar.gz hercules-ebecc72d189d931d1b5d8269afd0e89c8ac73c3d.tar.bz2 hercules-ebecc72d189d931d1b5d8269afd0e89c8ac73c3d.tar.xz hercules-ebecc72d189d931d1b5d8269afd0e89c8ac73c3d.zip |
Corrected some issues in the npc_removed_list and map_removed processing
- Removed the unnecessary DB_OPT_RELEASE_KEY flag (we don't want to
release the original key, but only the duplicate one, which is already
managed by DB_OPT_DUP_KEY)
- Added DB_OPT_NULL_DATA to the npc_removed_list DBMap (follow-up to
4aa5286, related #1430)
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/map.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/map.c b/src/map/map.c index d22b28689..5408cfbfa 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3996,7 +3996,7 @@ bool map_config_read_map_list(const char *filename, struct config_t *config, boo nullpo_retr(false, filename); nullpo_retr(false, config); - deleted_maps = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY|DB_OPT_ALLOW_NULL_DATA, MAP_NAME_LENGTH); + deleted_maps = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, MAP_NAME_LENGTH); // Remove maps if ((setting = libconfig->lookup(config, "map_configuration/map_removed")) != NULL) { @@ -4136,9 +4136,9 @@ bool map_read_npclist(const char *filename, bool imported) if (!libconfig->load_file(&config, filename)) return false; - deleted_npcs = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY, MAP_NAME_LENGTH); + deleted_npcs = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, MAP_NAME_LENGTH); - // Remove maps + // Remove NPCs if ((setting = libconfig->lookup(&config, "npc_removed_list")) != NULL) { int i, del_count = libconfig->setting_length(setting); for (i = 0; i < del_count; i++) { @@ -4149,7 +4149,7 @@ bool map_read_npclist(const char *filename, bool imported) strdb_put(deleted_npcs, scriptname, NULL); - if (imported) // Map list is empty on the first run, only do this for imported files. + if (imported) // NPC list is empty on the first run, only do this for imported files. npc->delsrcfile(scriptname); } } |