summaryrefslogtreecommitdiff
path: root/src/common/console.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-06-24 02:26:58 +0200
committerHaru <haru@dotalux.com>2018-06-24 02:26:58 +0200
commit9852b6ac5eea101aa71d80b01a41d46cb4add5d1 (patch)
treeb253a12eca416ab0b8bd1f330e97dab1af034fba /src/common/console.c
parent97243c6c325f980fcc90d7c814207070262efc7e (diff)
downloadhercules-9852b6ac5eea101aa71d80b01a41d46cb4add5d1.tar.gz
hercules-9852b6ac5eea101aa71d80b01a41d46cb4add5d1.tar.bz2
hercules-9852b6ac5eea101aa71d80b01a41d46cb4add5d1.tar.xz
hercules-9852b6ac5eea101aa71d80b01a41d46cb4add5d1.zip
Call the shutdown callback when terminating through the server exit console command
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/console.c')
-rw-r--r--src/common/console.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/console.c b/src/common/console.c
index 0b0a900f6..e7edd7e1e 100644
--- a/src/common/console.c
+++ b/src/common/console.c
@@ -133,7 +133,10 @@ int console_parse_key_pressed(void)
**/
CPCMD_C(exit, server)
{
- core->runflag = 0;
+ if (core->shutdown_callback != NULL)
+ core->shutdown_callback();
+ else
+ core->runflag = CORE_ST_STOP;
}
/**