mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Boot the whole bloody anykeydown mess back in place.
Okay, I tried to solve this issue the gentle way. But apparently it's not enough to track if a key is down. We must consider if the key is just down or if it's already repeating... Therefor raise the white flag and just put the original logic back in place. This may fix issue #57.
This commit is contained in:
parent
3eca8d4e32
commit
104fd04e55
1 changed files with 36 additions and 28 deletions
|
@ -914,34 +914,6 @@ Key_Event(int key, qboolean down, qboolean special)
|
|||
/* Track if key is down */
|
||||
keydown[key] = down;
|
||||
|
||||
/* This is one of the most ugly constructs I've
|
||||
found so far in Quake II. When the game is in
|
||||
the intermission, the player can press any key
|
||||
to end it and advance into the next level. It
|
||||
should be easy to figure out at server level if
|
||||
a button is pressed. But somehow the developers
|
||||
decided, that they'll need special move state
|
||||
BUTTON_ANY to solve this problem. So there's
|
||||
this global variable anykeydown. If it's not
|
||||
0, CL_FinishMove() encodes BUTTON_ANY into the
|
||||
button state. The server reads this value and
|
||||
sends it to gi->ClientThink() where it's used
|
||||
to determine if the intermission shall end.
|
||||
Needless to say that this is the only consumer
|
||||
of BUTTON_ANY.
|
||||
|
||||
Since we cannot alter the network protocol nor
|
||||
the server <-> game API, I'll leave things alone
|
||||
and try to forget. */
|
||||
if (down)
|
||||
{
|
||||
anykeydown++;
|
||||
}
|
||||
else
|
||||
{
|
||||
anykeydown--;
|
||||
}
|
||||
|
||||
/* Ignore most autorepeats */
|
||||
if (down)
|
||||
{
|
||||
|
@ -1040,6 +1012,42 @@ Key_Event(int key, qboolean down, qboolean special)
|
|||
}
|
||||
}
|
||||
|
||||
/* This is one of the most ugly constructs I've
|
||||
found so far in Quake II. When the game is in
|
||||
the intermission, the player can press any key
|
||||
to end it and advance into the next level. It
|
||||
should be easy to figure out at server level if
|
||||
a button is pressed. But somehow the developers
|
||||
decided, that they'll need special move state
|
||||
BUTTON_ANY to solve this problem. So there's
|
||||
this global variable anykeydown. If it's not
|
||||
0, CL_FinishMove() encodes BUTTON_ANY into the
|
||||
button state. The server reads this value and
|
||||
sends it to gi->ClientThink() where it's used
|
||||
to determine if the intermission shall end.
|
||||
Needless to say that this is the only consumer
|
||||
of BUTTON_ANY.
|
||||
|
||||
Since we cannot alter the network protocol nor
|
||||
the server <-> game API, I'll leave things alone
|
||||
and try to forget. */
|
||||
if (down)
|
||||
{
|
||||
if (key_repeats[key] == 1)
|
||||
{
|
||||
anykeydown++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
anykeydown--;
|
||||
|
||||
if (anykeydown < 0)
|
||||
{
|
||||
anykeydown = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* key up events only generate commands if the game key binding
|
||||
is a button command (leading+ sign). These will occur even in
|
||||
console mode, to keep the character from continuing an action
|
||||
|
|
Loading…
Reference in a new issue