mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
fix confim_quit
This commit is contained in:
parent
47a94ed6af
commit
76d004f9cf
2 changed files with 7 additions and 9 deletions
|
@ -36,6 +36,7 @@ static const char rcsid[] =
|
|||
#include "QF/cmd.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/csqc.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/draw.h"
|
||||
#include "QF/hash.h"
|
||||
#include "QF/plugin.h"
|
||||
|
@ -69,6 +70,8 @@ typedef struct menu_item_s {
|
|||
menu_pic_t *pics;
|
||||
} menu_item_t;
|
||||
|
||||
static cvar_t *confirm_quit;
|
||||
|
||||
static progs_t menu_pr_state;
|
||||
static menu_item_t *menu;
|
||||
static hashtab_t *menu_hash;
|
||||
|
@ -326,7 +329,7 @@ togglemenu_f (void)
|
|||
static void
|
||||
quit_f (void)
|
||||
{
|
||||
if (menu_quit) {
|
||||
if (confirm_quit->int_val && menu_quit) {
|
||||
PR_ExecuteProgram (&menu_pr_state, menu_quit);
|
||||
if (!G_INT (&menu_pr_state, OFS_RETURN))
|
||||
return;
|
||||
|
@ -384,6 +387,9 @@ Menu_Init (void)
|
|||
PR_Cmds_Init (&menu_pr_state);
|
||||
R_Progs_Init (&menu_pr_state);
|
||||
|
||||
confirm_quit = Cvar_Get ("confirm_quit", "1", CVAR_ARCHIVE, NULL,
|
||||
"confirm quit command");
|
||||
|
||||
Cmd_AddCommand ("togglemenu", togglemenu_f,
|
||||
"Toggle the display of the menu");
|
||||
Cmd_AddCommand ("quit", quit_f, "Exit the program");
|
||||
|
|
|
@ -226,7 +226,6 @@ char prespawn_name[] = "prespawn %i 0 %i";
|
|||
char modellist_name[] = "modellist %i %i";
|
||||
char soundlist_name[] = "soundlist %i %i";
|
||||
|
||||
cvar_t *confirm_quit;
|
||||
|
||||
void CL_RSShot_f (void);
|
||||
|
||||
|
@ -241,11 +240,6 @@ CL_Sbar_f (cvar_t *var)
|
|||
void
|
||||
CL_Quit_f (void)
|
||||
{
|
||||
// FIXME: MENUCODE
|
||||
// if (confirm_quit->int_val) {
|
||||
// M_Menu_Quit_f ();
|
||||
// return;
|
||||
// }
|
||||
if (!con_module)
|
||||
Con_Printf ("I hope you wanted to quit\n");
|
||||
CL_Disconnect ();
|
||||
|
@ -1232,8 +1226,6 @@ CL_Init_Cvars (void)
|
|||
"vars. Required by some servers, but clearing "
|
||||
"this can make the difference between "
|
||||
"connecting and not connecting on some others.");
|
||||
confirm_quit = Cvar_Get ("confirm_quit", "1", CVAR_ARCHIVE, NULL,
|
||||
"confirm quit command");
|
||||
cl_allow_cmd_pkt = Cvar_Get ("cl_allow_cmd_pkt", "1", CVAR_NONE, NULL,
|
||||
"enables packets from the likes of gamespy");
|
||||
cl_paranoid = Cvar_Get ("cl_paranoid", "1", CVAR_NONE, NULL,
|
||||
|
|
Loading…
Reference in a new issue