- Fixed: C_DoKey() must disable all doublebind processing if it isn't passed any doublebindings.

This is because the automap calls it with its own bindings, which effectively cancelled all
  doublebindings while the automap was open.

SVN r3354 (trunk)
This commit is contained in:
Randy Heit 2012-02-11 01:44:56 +00:00
parent d2c8a86bb4
commit 033b3964f1
2 changed files with 42 additions and 40 deletions

View file

@ -829,6 +829,7 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds)
bool dclick; bool dclick;
int dclickspot; int dclickspot;
BYTE dclickmask; BYTE dclickmask;
unsigned int nowtime;
if (ev->type != EV_KeyDown && ev->type != EV_KeyUp) if (ev->type != EV_KeyDown && ev->type != EV_KeyUp)
return false; return false;
@ -841,10 +842,11 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds)
dclick = false; dclick = false;
// This used level.time which didn't work outside a level. // This used level.time which didn't work outside a level.
if (DClickTime[ev->data1] > I_MSTime() && ev->type == EV_KeyDown) nowtime = I_MSTime();
if (doublebinds != NULL && DClickTime[ev->data1] > nowtime && ev->type == EV_KeyDown)
{ {
// Key pressed for a double click // Key pressed for a double click
if (doublebinds != NULL) binding = doublebinds->GetBinding(ev->data1); binding = doublebinds->GetBinding(ev->data1);
DClicked[dclickspot] |= dclickmask; DClicked[dclickspot] |= dclickmask;
dclick = true; dclick = true;
} }
@ -853,11 +855,11 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds)
if (ev->type == EV_KeyDown) if (ev->type == EV_KeyDown)
{ // Key pressed for a normal press { // Key pressed for a normal press
binding = binds->GetBinding(ev->data1); binding = binds->GetBinding(ev->data1);
DClickTime[ev->data1] = I_MSTime() + 571; DClickTime[ev->data1] = nowtime + 571;
} }
else if (DClicked[dclickspot] & dclickmask) else if (doublebinds != NULL && DClicked[dclickspot] & dclickmask)
{ // Key released from a double click { // Key released from a double click
if (doublebinds != NULL) binding = doublebinds->GetBinding(ev->data1); binding = doublebinds->GetBinding(ev->data1);
DClicked[dclickspot] &= ~dclickmask; DClicked[dclickspot] &= ~dclickmask;
DClickTime[ev->data1] = 0; DClickTime[ev->data1] = 0;
dclick = true; dclick = true;