From c940d5f31aea1220c684189dc06206a400f59e99 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 18 Sep 2016 01:32:22 +0200 Subject: Removed special handling of "all" by npc->delsrcfile() - Use npc->clearsrcfile() instead. Signed-off-by: Haru --- src/map/npc.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/map') diff --git a/src/map/npc.c b/src/map/npc.c index 36078837f..efc27c258 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2464,24 +2464,21 @@ void npc_addsrcfile(const char* name) file_prev->next = file; } -/// Removes a npc source file (or all) -void npc_delsrcfile(const char* name) +/** + * Removes a npc source file. + * + * @param name The file name to remove. + */ +void npc_delsrcfile(const char *name) { struct npc_src_list* file = npc->src_files; struct npc_src_list* file_prev = NULL; nullpo_retv(name); - if( strcmpi(name, "all") == 0 ) - { - npc->clearsrcfile(); - return; - } - while( file != NULL ) - { - if( strcmp(file->name, name) == 0 ) - { - if( npc->src_files == file ) + while (file != NULL) { + if (strcmp(file->name, name) == 0) { + if (npc->src_files == file) npc->src_files = file->next; else file_prev->next = file->next; -- cgit v1.2.3-70-g09d2