summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-24 17:50:42 -0300
committershennetsind <ind@henn.et>2014-02-24 17:50:42 -0300
commit3c87f3a57294b41a0c3c6af953a37ffcad9c8f19 (patch)
treef87fa67eb3adfd0679c47d19c66eac005c1b3cce /src/map/map.c
parent24551d9a2d9ba7e275c4dfe940a5acb941670cc5 (diff)
downloadhercules-3c87f3a57294b41a0c3c6af953a37ffcad9c8f19.tar.gz
hercules-3c87f3a57294b41a0c3c6af953a37ffcad9c8f19.tar.bz2
hercules-3c87f3a57294b41a0c3c6af953a37ffcad9c8f19.tar.xz
hercules-3c87f3a57294b41a0c3c6af953a37ffcad9c8f19.zip
Fixed console parse gm command crash on select commands
Also fixed an issue with socket flushing Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c10
1 files changed, 7 insertions, 3 deletions
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 <optional params>"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;