summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-05-10 17:56:06 +0200
committerHaru <haru@dotalux.com>2014-05-10 17:56:06 +0200
commit7fc4d0ce2bce6e896ad4aa5d16348f14e5039189 (patch)
treeb2257295d115de358b638291431ebcc4f3777f72
parent65e43c2ab18a446102dea9237cfd4152392d7f33 (diff)
downloadhercules-7fc4d0ce2bce6e896ad4aa5d16348f14e5039189.tar.gz
hercules-7fc4d0ce2bce6e896ad4aa5d16348f14e5039189.tar.bz2
hercules-7fc4d0ce2bce6e896ad4aa5d16348f14e5039189.tar.xz
hercules-7fc4d0ce2bce6e896ad4aa5d16348f14e5039189.zip
Follow-up to 5f1529083ad1f35a3ac66cc041ee74d6db2f3552
- Now the map-server returns nonzero even on nomral runs (or --run-once) if any script failed loading. Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/npc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 8e5854dbf..cf509e11f 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -4306,7 +4306,8 @@ void npc_process_files( int npc_min ) {
ShowStatus("Loading NPCs...\r");
for( file = npc->src_files; file != NULL; file = file->next ) {
ShowStatus("Loading NPC file: %s"CL_CLL"\r", file->name);
- npc->parsesrcfile(file->name, false);
+ if (npc->parsesrcfile(file->name, false) != EXIT_SUCCESS)
+ map->retval = EXIT_FAILURE;
}
ShowInfo ("Done loading '"CL_WHITE"%d"CL_RESET"' NPCs:"CL_CLL"\n"
"\t-'"CL_WHITE"%d"CL_RESET"' Warps\n"
@@ -4325,6 +4326,9 @@ int npc_reload(void) {
struct s_mapiterator* iter;
struct block_list* bl;
+ if (map->retval == EXIT_FAILURE)
+ map->retval = EXIT_SUCCESS; // Clear return status in case something failed before.
+
/* clear guild flag cache */
guild->flags_clear();