From 7fc4d0ce2bce6e896ad4aa5d16348f14e5039189 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 10 May 2014 17:56:06 +0200 Subject: 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 --- src/map/npc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3-60-g2f50