mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 01:01:07 +00:00
JPG's smartjump feature, via r00k.
This commit is contained in:
parent
6643ef0f32
commit
dab8e4a39e
1 changed files with 19 additions and 0 deletions
|
@ -59,6 +59,8 @@ kbutton_t in_up, in_down;
|
|||
|
||||
int in_impulse;
|
||||
|
||||
// JPG 1.05 - translate +jump to +moveup under water
|
||||
//extern cvar_t pq_moveup;
|
||||
|
||||
void KeyDown (kbutton_t *b)
|
||||
{
|
||||
|
@ -71,6 +73,10 @@ void KeyDown (kbutton_t *b)
|
|||
else
|
||||
k = -1; // typed manually at the console for continuous down
|
||||
|
||||
// JPG 1.05 - if jump is pressed underwater, translate it to a moveup
|
||||
if (b == &in_jump /*&& pq_moveup.value*/ && cl.stats[STAT_HEALTH] > 0 && cl.inwater)
|
||||
b = &in_up;
|
||||
|
||||
if (k == b->down[0] || k == b->down[1])
|
||||
return; // repeating key
|
||||
|
||||
|
@ -104,6 +110,19 @@ void KeyUp (kbutton_t *b)
|
|||
return;
|
||||
}
|
||||
|
||||
// JPG 1.05 - check to see if we need to translate -jump to -moveup
|
||||
if (b == &in_jump/* && pq_moveup.value*/)
|
||||
{
|
||||
if (k == in_up.down[0] || k == in_up.down[1])
|
||||
b = &in_up;
|
||||
else
|
||||
{
|
||||
// in case a -moveup got lost somewhere
|
||||
in_up.down[0] = in_up.down[1] = 0;
|
||||
in_up.state = 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (b->down[0] == k)
|
||||
b->down[0] = 0;
|
||||
else if (b->down[1] == k)
|
||||
|
|
Loading…
Reference in a new issue