Skip to content

Commit

Permalink
Merge pull request scp-fs2open#6251 from Goober5000/popup_keys_fix
Browse files Browse the repository at this point in the history
fix incorrect processing of keys during ESC popup
  • Loading branch information
Goober5000 authored Jul 15, 2024
2 parents 3d556af + 6f05c26 commit 1db093e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions code/popup/popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,11 @@ void popup_play_default_change_sound(popup_info *pi)
// POPUP_NOCHANGE => nothing happenned
int popup_process_keys(popup_info *pi, int k, int flags)
{
int i, masked_k;

if ( k <= 0 ) {
return POPUP_NOCHANGE;
}

for ( i = 0; i < pi->nchoices; i++ ) {
for ( int i = 0; i < pi->nchoices; i++ ) {
if ( pi->keypress[i] == key_to_ascii(k) ) {
Popup_default_choice=i;
Popup_buttons[i].press_button();
Expand Down Expand Up @@ -346,13 +344,6 @@ int popup_process_keys(popup_info *pi, int k, int flags)
break;
} // end switch


masked_k = k & ~KEY_CTRLED; // take out CTRL modifier only
if ( (Game_mode & GM_IN_MISSION) ) {
process_set_of_keys(masked_k, Dead_key_set_size, Dead_key_set);
button_info_do(&Player->bi); // call functions based on status of button_info bit vectors
}

return POPUP_NOCHANGE;
}

Expand Down
2 changes: 1 addition & 1 deletion code/popup/popup.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
// misc
#define PF_RUN_STATE (1<<22) // call the do frame of the current state underneath the popup
#define PF_IGNORE_ESC (1<<23) // ignore the escape character
#define PF_ALLOW_DEAD_KEYS (1<<24) // Allow player to use keyset that exists when player dies
#define PF_UNUSED_0 (1<<24) // Previously PF_ALLOW_DEAD_KEYS, but this was unused even in retail
#define PF_NO_NETWORKING (1<<25) // don't do any networking

// no special buttons
Expand Down

0 comments on commit 1db093e

Please sign in to comment.