- 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

@ -1917,13 +1917,13 @@ bool AM_Check3DFloors(line_t *line)
//============================================================================= //=============================================================================
void AM_drawWalls (bool allmap) void AM_drawWalls (bool allmap)
{ {
int i; int i;
static mline_t l; static mline_t l;
int lock, color; int lock, color;
for (i = 0; i < numlines; i++) for (i = 0; i < numlines; i++)
{ {
l.a.x = lines[i].v1->x >> FRACTOMAPBITS; l.a.x = lines[i].v1->x >> FRACTOMAPBITS;
l.a.y = lines[i].v1->y >> FRACTOMAPBITS; l.a.y = lines[i].v1->y >> FRACTOMAPBITS;
l.b.x = lines[i].v2->x >> FRACTOMAPBITS; l.b.x = lines[i].v2->x >> FRACTOMAPBITS;
@ -1953,22 +1953,22 @@ void AM_drawWalls (bool allmap)
else if (lines[i].flags & ML_SECRET) else if (lines[i].flags & ML_SECRET)
{ // secret door { // secret door
if (am_cheat != 0 && lines[i].backsector != NULL) if (am_cheat != 0 && lines[i].backsector != NULL)
AM_drawMline(&l, SecretWallColor); AM_drawMline(&l, SecretWallColor);
else else
AM_drawMline(&l, WallColor); AM_drawMline(&l, WallColor);
} else if (lines[i].locknumber > 0) { // [Dusk] specials w/ locknumbers } else if (lines[i].locknumber > 0) { // [Dusk] specials w/ locknumbers
lock = lines[i].locknumber; lock = lines[i].locknumber;
color = P_GetMapColorForLock(lock); color = P_GetMapColorForLock(lock);
AMColor c; AMColor c;
if (color >= 0) c.FromRGB(RPART(color), GPART(color), BPART(color)); if (color >= 0) c.FromRGB(RPART(color), GPART(color), BPART(color));
else c = LockedColor; else c = LockedColor;
AM_drawMline (&l, c); AM_drawMline (&l, c);
} else if ((lines[i].special == Teleport || } else if ((lines[i].special == Teleport ||
lines[i].special == Teleport_NoFog || lines[i].special == Teleport_NoFog ||
lines[i].special == Teleport_ZombieChanger || lines[i].special == Teleport_ZombieChanger ||
lines[i].special == Teleport_Line) && lines[i].special == Teleport_Line) &&
(lines[i].activation & SPAC_PlayerActivate) && (lines[i].activation & SPAC_PlayerActivate) &&
am_colorset == 0) am_colorset == 0)
{ // intra-level teleporters { // intra-level teleporters
@ -1988,18 +1988,18 @@ void AM_drawWalls (bool allmap)
(lines[i].special == Door_Animated && lines[i].args[3] != 0) || (lines[i].special == Door_Animated && lines[i].args[3] != 0) ||
(lines[i].special == Generic_Door && lines[i].args[4] != 0)) (lines[i].special == Generic_Door && lines[i].args[4] != 0))
{ {
if (am_colorset == 0 || am_colorset == 3) // Raven games show door colors if (am_colorset == 0 || am_colorset == 3) // Raven games show door colors
{ {
int P_GetMapColorForLock(int lock); int P_GetMapColorForLock(int lock);
if (lines[i].special==Door_LockedRaise || lines[i].special==Door_Animated) if (lines[i].special==Door_LockedRaise || lines[i].special==Door_Animated)
lock=lines[i].args[3]; lock=lines[i].args[3];
else lock=lines[i].args[4]; else lock=lines[i].args[4];
color = P_GetMapColorForLock(lock); color = P_GetMapColorForLock(lock);
AMColor c; AMColor c;
if (color >= 0) c.FromRGB(RPART(color), GPART(color), BPART(color)); if (color >= 0) c.FromRGB(RPART(color), GPART(color), BPART(color));
else c = LockedColor; else c = LockedColor;

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;