From 2d6952b84e5245052068b0a0512914d838f03ad6 Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 8 Jul 2015 19:32:16 +0000 Subject: [PATCH] fix a few bugs and quirks. yay. including one that crashes while playing ctf demos. oops. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4936 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/menu.c | 14 +++++++++----- engine/client/pr_csqc.c | 12 ++++++++++++ engine/client/view.c | 2 +- engine/common/cvar.c | 10 ++++++++++ engine/server/pr_cmds.c | 7 ++++--- 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/engine/client/menu.c b/engine/client/menu.c index 8624c715d..97b8cf5f7 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -1135,7 +1135,6 @@ void M_Init_Internal (void) #endif Cmd_AddCommand ("menu_single", M_Menu_SinglePlayer_f); Cmd_AddCommand ("menu_multi", M_Menu_MultiPlayer_f); - Cmd_AddCommand ("menu_demo", M_Menu_Demos_f); Cmd_AddCommand ("menu_keys", M_Menu_Keys_f); Cmd_AddCommand ("help", M_Menu_Help_f); @@ -1148,8 +1147,6 @@ void M_Init_Internal (void) Cmd_AddCommand ("modelviewer", M_Menu_ModelViewer_f); #ifdef CL_MASTER - Cmd_AddCommand ("menu_servers", M_Menu_ServerList2_f); - Cmd_AddCommand ("menu_slist", M_Menu_ServerList2_f); #endif Cmd_AddCommand ("menu_setup", M_Menu_Setup_f); @@ -1207,7 +1204,6 @@ void M_DeInit_Internal (void) #endif Cmd_RemoveCommand ("menu_single"); Cmd_RemoveCommand ("menu_multi"); - Cmd_RemoveCommand ("menu_demo"); Cmd_RemoveCommand ("menu_keys"); Cmd_RemoveCommand ("help"); @@ -1218,7 +1214,6 @@ void M_DeInit_Internal (void) Cmd_RemoveCommand ("menu_mediafiles"); #ifdef CL_MASTER - Cmd_RemoveCommand ("menu_servers"); Cmd_RemoveCommand ("menu_slist"); #endif Cmd_RemoveCommand ("menu_setup"); @@ -1285,6 +1280,15 @@ void M_Init (void) Cmd_AddCommand("fps_preset", FPS_Preset_f); Cmd_AddCommand("menupop", M_MenuPop_f); + //server browser is kinda complex, and has clipboard integration which we need to sandbox a little +#ifdef CL_MASTER + Cmd_AddCommand ("menu_servers", M_Menu_ServerList2_f); +#endif + //demo menu is allowed to see outside of the quakedir. you can't replicate that in qc's sandbox. + Cmd_AddCommand ("menu_demo", M_Menu_Demos_f); + + + Cvar_Register(&m_preset_chosen, "Menu thingumiebobs"); Cvar_Register(&m_helpismedia, "Menu thingumiebobs"); diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index c121abb22..54f2ff5f6 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -2718,6 +2718,17 @@ static void QCBUILTIN PF_cl_setcursormode (pubprogfuncs_t *prinst, struct global } } +static void QCBUILTIN PF_cl_getcursormode (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) +{ + world_t *world = prinst->parms->user; + if (G_FLOAT(OFS_PARM0)) + G_FLOAT(OFS_RETURN) = Key_MouseShouldBeFree(); + else if (key_dest_absolutemouse & world->keydestmask) + G_FLOAT(OFS_RETURN) = TRUE; + else + G_FLOAT(OFS_RETURN) = FALSE; +} + //get the input commands, and stuff them into some globals. static void QCBUILTIN PF_cs_getinputstate (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) { @@ -5115,6 +5126,7 @@ static struct { {"getkeybind", PF_cl_getkeybind, 342}, // #342 string(float keynum) getkeybind (EXT_CSQC) {"setcursormode", PF_cl_setcursormode, 343}, // #343 This is originally a DP extension + {"getcursormode", PF_cl_getcursormode, 0}, // #343 This is originally a DP extension {"getmousepos", PF_cl_getmousepos, 344}, // #344 This is a DP extension {"getinputstate", PF_cs_getinputstate, 345}, // #345 float(float framenum) getinputstate (EXT_CSQC) diff --git a/engine/client/view.c b/engine/client/view.c index 7d6742b7e..2e1274706 100644 --- a/engine/client/view.c +++ b/engine/client/view.c @@ -1672,7 +1672,7 @@ static void SCR_DrawAutoID(vec3_t org, player_info_t *pl, qboolean isteam) h = 8; y += (h-8)/2; - for (r = 7; r>=0; r--) + for (r = countof(wbitnames)-1; r>=0; r--) if (items & (1<