diff options
author | Haru <haru@dotalux.com> | 2016-09-18 01:36:17 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-09-18 01:44:48 +0200 |
commit | 9068ec7dc0e85cd3f7f8f9a11a3b7f06dc24f4f6 (patch) | |
tree | d6132f5dcbcc8b5caae346169f9b1e26b76c6405 /src/map/npc.c | |
parent | c940d5f31aea1220c684189dc06206a400f59e99 (diff) | |
download | hercules-9068ec7dc0e85cd3f7f8f9a11a3b7f06dc24f4f6.tar.gz hercules-9068ec7dc0e85cd3f7f8f9a11a3b7f06dc24f4f6.tar.bz2 hercules-9068ec7dc0e85cd3f7f8f9a11a3b7f06dc24f4f6.tar.xz hercules-9068ec7dc0e85cd3f7f8f9a11a3b7f06dc24f4f6.zip |
Removed special handling of "clear" in npc->addsrcfile()
- Use npc->clearsrcfile() instead.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index efc27c258..9791b66a5 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2432,24 +2432,22 @@ void npc_clearsrcfile(void) npc->src_files = NULL; } -/// Adds a npc source file (or removes all) -void npc_addsrcfile(const char* name) +/** + * Adds a npc source file. + * + * @param name The file name to add. + */ +void npc_addsrcfile(const char *name) { struct npc_src_list* file; struct npc_src_list* file_prev = NULL; nullpo_retv(name); - if( strcmpi(name, "clear") == 0 ) - { - npc->clearsrcfile(); - return; - } // prevent multiple insert of source files file = npc->src_files; - while( file != NULL ) - { - if( strcmp(name, file->name) == 0 ) + while (file != NULL) { + if (strcmp(name, file->name) == 0) return;// found the file, no need to insert it again file_prev = file; file = file->next; |