mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
fix some segfaults caused by my menu_item->text changes
This commit is contained in:
parent
ec47e08e1c
commit
f1938f6b36
1 changed files with 10 additions and 4 deletions
|
@ -563,8 +563,11 @@ Menu_KeyEvent (knum_t key, short unicode, qboolean down)
|
|||
} else if (menu->items && menu->items[menu->cur_item]->func
|
||||
&& menu->items[menu->cur_item]->allkeys) {
|
||||
item = menu->items[menu->cur_item];
|
||||
G_INT (&menu_pr_state, OFS_PARM0) =
|
||||
PR_SetString (&menu_pr_state, item->text);
|
||||
if (item->text)
|
||||
G_INT (&menu_pr_state, OFS_PARM0) =
|
||||
PR_SetString (&menu_pr_state, item->text);
|
||||
else
|
||||
G_INT (&menu_pr_state, OFS_PARM0) = 0;
|
||||
G_INT (&menu_pr_state, OFS_PARM1) = key;
|
||||
PR_ExecuteProgram (&menu_pr_state, item->func);
|
||||
if (G_INT (&menu_pr_state, OFS_RETURN))
|
||||
|
@ -588,8 +591,11 @@ Menu_KeyEvent (knum_t key, short unicode, qboolean down)
|
|||
{
|
||||
item = menu->items[menu->cur_item];
|
||||
if (item->func) {
|
||||
G_INT (&menu_pr_state, OFS_PARM0) =
|
||||
PR_SetString (&menu_pr_state, item->text);
|
||||
if (item->text)
|
||||
G_INT (&menu_pr_state, OFS_PARM0) =
|
||||
PR_SetString (&menu_pr_state, item->text);
|
||||
else
|
||||
G_INT (&menu_pr_state, OFS_PARM0) = 0;
|
||||
G_INT (&menu_pr_state, OFS_PARM1) = key;
|
||||
PR_ExecuteProgram (&menu_pr_state, item->func);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue