From 3c87f3a57294b41a0c3c6af953a37ffcad9c8f19 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Mon, 24 Feb 2014 17:50:42 -0300 Subject: Fixed console parse gm command crash on select commands Also fixed an issue with socket flushing Signed-off-by: shennetsind --- src/map/map.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index 4bc272035..b45863b11 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -5423,13 +5423,15 @@ CPCMD(gm_use) { ShowError("gm:use invalid syntax. use '"CL_WHITE"gm:use @command "CL_RESET"'\n"); return; } - map->cpsd->fd = -2; + + map->cpsd_active = true; + if( !atcommand->exec(map->cpsd->fd, map->cpsd, line, false) ) ShowInfo("HCP: '"CL_WHITE"%s"CL_RESET"' failed\n",line); else ShowInfo("HCP: '"CL_WHITE"%s"CL_RESET"' was used\n",line); - map->cpsd->fd = 0; - + + map->cpsd_active = false; } /* Hercules Console Parser */ void map_cp_defaults(void) { @@ -5840,6 +5842,8 @@ void map_defaults(void) { sprintf(map->server_db,"ragnarok"); map->mysql_handle = NULL; + map->cpsd_active = false; + map->port = 0; map->users = 0; map->ip_set = 0; -- cgit v1.2.3-60-g2f50