diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index afc421160..c9cf1d66f 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -205,6 +205,8 @@ CL_ReadConfiguration (const char *cfg_name) Qclose (cfg_file); plitem_t *config = PL_GetPropertyList (cfg, 0); + free (cfg); + if (!config) { return 0; } @@ -620,8 +622,6 @@ CL_Init (cbuf_t *cbuf) { byte *basepal, *colormap; - Sys_RegisterShutdown (CL_Shutdown, 0); - basepal = (byte *) QFS_LoadHunkFile (QFS_FOpenFile ("gfx/palette.lmp")); if (!basepal) Sys_Error ("Couldn't load gfx/palette.lmp"); @@ -662,6 +662,8 @@ CL_Init (cbuf_t *cbuf) Cmd_AddCommand ("force_centerview", Force_CenterView_f, "force the view " "to be level"); + Sys_RegisterShutdown (CL_Shutdown, 0); + SZ_Alloc (&cls.message, 1024); CL_SetState (ca_disconnected); } diff --git a/nq/source/host.c b/nq/source/host.c index b1cade921..f79b29856 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -1012,6 +1012,7 @@ Host_ExecConfig (cbuf_t *cbuf, int skip_quakerc) void Host_Init (void) { + Sys_RegisterShutdown (Host_Shutdown, 0); Sys_Printf ("Host_Init\n"); host_cbuf = Cbuf_New (&id_interp); @@ -1052,6 +1053,8 @@ Host_Init (void) con_module->data->console->realtime = &con_realtime; con_module->data->console->frametime = &con_frametime; con_module->data->console->quit = Host_Quit_f; + //FIXME need to rethink cbuf connections (they can form a stack) + Cbuf_DeleteStack (con_module->data->console->cbuf); con_module->data->console->cbuf = host_cbuf; } diff --git a/nq/source/sbar.c b/nq/source/sbar.c index 8e298f6aa..2532d1611 100644 --- a/nq/source/sbar.c +++ b/nq/source/sbar.c @@ -1003,6 +1003,7 @@ sbar_update_vis (void) void Sbar_Draw (void) { + if (!cl.players) return; //FIXME draw_miniteam sbar_update_vis (); hud_main_view->draw (hud_main_view); } @@ -1491,6 +1492,11 @@ init_hud_views (void) if (hud_frags_view) view_add (hud_inventory_view, hud_frags_view); + if (minifrags_view) + view_add (hud_view, minifrags_view); + if (miniteam_view) + view_add (hud_view, miniteam_view); + view = view_new (0, 0, r_data->vid->conview->xlen, 48, grav_south); view_add (view, hud_view); hud_view = view; diff --git a/nq/source/sys_sdl.c b/nq/source/sys_sdl.c index 70193fd74..21a850023 100644 --- a/nq/source/sys_sdl.c +++ b/nq/source/sys_sdl.c @@ -113,7 +113,6 @@ SDL_main (int argc, char *argv[]) isDedicated = (COM_CheckParm ("-dedicated") != 0); - Sys_RegisterShutdown (Host_Shutdown, 0); Sys_RegisterShutdown (shutdown_f, 0); Host_Init (); diff --git a/nq/source/sys_unix.c b/nq/source/sys_unix.c index 83d61a105..bcf8b801f 100644 --- a/nq/source/sys_unix.c +++ b/nq/source/sys_unix.c @@ -75,7 +75,6 @@ main (int argc, const char **argv) isDedicated = (COM_CheckParm ("-dedicated") != 0); - Sys_RegisterShutdown (Host_Shutdown, 0); Sys_RegisterShutdown (shutdown_f, 0); Host_Init (); diff --git a/nq/source/sys_unixd.c b/nq/source/sys_unixd.c index 2971e2242..b444eb29b 100644 --- a/nq/source/sys_unixd.c +++ b/nq/source/sys_unixd.c @@ -86,7 +86,6 @@ main (int argc, const char **argv) host_parms.argc = com_argc; host_parms.argv = com_argv; - Sys_RegisterShutdown (Host_Shutdown, 0); Sys_RegisterShutdown (shutdown_f, 0); Host_Init (); diff --git a/nq/source/sys_win.c b/nq/source/sys_win.c index eb543d1c9..99cb143dc 100644 --- a/nq/source/sys_win.c +++ b/nq/source/sys_win.c @@ -207,7 +207,6 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, if (!isDedicated) init_handles (hInstance); - Sys_RegisterShutdown (Host_Shutdown, 0); Sys_RegisterShutdown (shutdown_f, 0); Host_Init (); diff --git a/nq/source/sys_wind.c b/nq/source/sys_wind.c index 0f1681278..964e825bf 100644 --- a/nq/source/sys_wind.c +++ b/nq/source/sys_wind.c @@ -69,7 +69,6 @@ main (int argc, const char **argv) host_parms.argc = com_argc; host_parms.argv = com_argv; - Sys_RegisterShutdown (Host_Shutdown, 0); Sys_RegisterShutdown (shutdown_f, 0); Host_Init ();