From 75273485c47247d13e5d533b19b65402db6d660c Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 30 Mar 2008 19:38:08 +0000 Subject: fixed closing of map download when disconnecting --- src/engine/client/ec_client.c | 10 ++++++++++ src/game/g_variables.h | 2 +- src/game/server/gs_server.cpp | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/engine/client/ec_client.c b/src/engine/client/ec_client.c index 142c8b70..4e139b75 100644 --- a/src/engine/client/ec_client.c +++ b/src/engine/client/ec_client.c @@ -499,6 +499,16 @@ void client_disconnect_with_reason(const char *reason) netclient_disconnect(net, reason); client_set_state(CLIENTSTATE_OFFLINE); map_unload(); + + /* disable all downloads */ + mapdownload_chunk = 0; + if(mapdownload_file) + io_close(mapdownload_file); + mapdownload_file = 0; + mapdownload_crc = 0; + mapdownload_totalsize = -1; + mapdownload_amount = 0; + } void client_disconnect() diff --git a/src/game/g_variables.h b/src/game/g_variables.h index c08bd10d..02ad4fbc 100644 --- a/src/game/g_variables.h +++ b/src/game/g_variables.h @@ -28,7 +28,7 @@ MACRO_CONFIG_INT(player_color_body, 65408, 0, 0) MACRO_CONFIG_INT(player_color_feet, 65408, 0, 0) MACRO_CONFIG_STR(player_skin, 64, "default") -MACRO_CONFIG_INT(dbg_bots, 0, 0, 11) +MACRO_CONFIG_INT(dbg_dummies, 0, 0, 11) MACRO_CONFIG_INT(dbg_firedelay, 0, 0, 1) MACRO_CONFIG_INT(dbg_flow, 0, 0, 1) MACRO_CONFIG_INT(dbg_tuning, 0, 0, 1) diff --git a/src/game/server/gs_server.cpp b/src/game/server/gs_server.cpp index 22962470..bebce635 100644 --- a/src/game/server/gs_server.cpp +++ b/src/game/server/gs_server.cpp @@ -2314,9 +2314,9 @@ void mods_init() world->insert_entity(gameobj); - if(config.dbg_bots) + if(config.dbg_dummies) { - for(int i = 0; i < config.dbg_bots ; i++) + for(int i = 0; i < config.dbg_dummies ; i++) { mods_connected(MAX_CLIENTS-i-1); mods_client_enter(MAX_CLIENTS-i-1); -- cgit 1.4.1