- 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)
{
int i;
static mline_t l;
int lock, color;
for (i = 0; i < numlines; i++)
{
{
int i;
static mline_t l;
int lock, color;
for (i = 0; i < numlines; i++)
{
l.a.x = lines[i].v1->x >> FRACTOMAPBITS;
l.a.y = lines[i].v1->y >> 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)
{ // secret door
if (am_cheat != 0 && lines[i].backsector != NULL)
AM_drawMline(&l, SecretWallColor);
else
AM_drawMline(&l, WallColor);
} else if (lines[i].locknumber > 0) { // [Dusk] specials w/ locknumbers
lock = lines[i].locknumber;
color = P_GetMapColorForLock(lock);
AMColor c;
if (color >= 0) c.FromRGB(RPART(color), GPART(color), BPART(color));
else c = LockedColor;
AM_drawMline (&l, c);
} else if ((lines[i].special == Teleport ||
lines[i].special == Teleport_NoFog ||
lines[i].special == Teleport_ZombieChanger ||
lines[i].special == Teleport_Line) &&
AM_drawMline(&l, SecretWallColor);
else
AM_drawMline(&l, WallColor);
} else if (lines[i].locknumber > 0) { // [Dusk] specials w/ locknumbers
lock = lines[i].locknumber;
color = P_GetMapColorForLock(lock);
AMColor c;
if (color >= 0) c.FromRGB(RPART(color), GPART(color), BPART(color));
else c = LockedColor;
AM_drawMline (&l, c);
} else if ((lines[i].special == Teleport ||
lines[i].special == Teleport_NoFog ||
lines[i].special == Teleport_ZombieChanger ||
lines[i].special == Teleport_Line) &&
(lines[i].activation & SPAC_PlayerActivate) &&
am_colorset == 0)
{ // 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 == Generic_Door && lines[i].args[4] != 0))
{
if (am_colorset == 0 || am_colorset == 3) // Raven games show door colors
{
int P_GetMapColorForLock(int lock);
if (lines[i].special==Door_LockedRaise || lines[i].special==Door_Animated)
lock=lines[i].args[3];
else lock=lines[i].args[4];
color = P_GetMapColorForLock(lock);
AMColor c;
if (am_colorset == 0 || am_colorset == 3) // Raven games show door colors
{
int P_GetMapColorForLock(int lock);
if (lines[i].special==Door_LockedRaise || lines[i].special==Door_Animated)
lock=lines[i].args[3];
else lock=lines[i].args[4];
color = P_GetMapColorForLock(lock);
AMColor c;
if (color >= 0) c.FromRGB(RPART(color), GPART(color), BPART(color));
else c = LockedColor;

View file

@ -829,6 +829,7 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds)
bool dclick;
int dclickspot;
BYTE dclickmask;
unsigned int nowtime;
if (ev->type != EV_KeyDown && ev->type != EV_KeyUp)
return false;
@ -841,10 +842,11 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds)
dclick = false;
// 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
if (doublebinds != NULL) binding = doublebinds->GetBinding(ev->data1);
binding = doublebinds->GetBinding(ev->data1);
DClicked[dclickspot] |= dclickmask;
dclick = true;
}
@ -853,11 +855,11 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds)
if (ev->type == EV_KeyDown)
{ // Key pressed for a normal press
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
if (doublebinds != NULL) binding = doublebinds->GetBinding(ev->data1);
binding = doublebinds->GetBinding(ev->data1);
DClicked[dclickspot] &= ~dclickmask;
DClickTime[ev->data1] = 0;
dclick = true;