mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Speed up the cycle if typing quickly
This commit is contained in:
parent
62ca621827
commit
a3c72c0158
1 changed files with 16 additions and 0 deletions
16
src/p_user.c
16
src/p_user.c
|
|
@ -4598,6 +4598,22 @@ void P_PlayerThink(player_t *player)
|
||||||
*/
|
*/
|
||||||
if (cmd->flags & TICCMD_KEYSTROKE)
|
if (cmd->flags & TICCMD_KEYSTROKE)
|
||||||
{
|
{
|
||||||
|
/* speed up if we are typing quickly! */
|
||||||
|
if (player->typing_duration > 0 && player->typing_timer > 12)
|
||||||
|
{
|
||||||
|
if (player->typing_duration < 16)
|
||||||
|
{
|
||||||
|
player->typing_duration = 24;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* slows down a tiny bit as it approaches the next dot */
|
||||||
|
const UINT8 step = (((player->typing_duration + 15) & ~15) -
|
||||||
|
player->typing_duration) / 2;
|
||||||
|
player->typing_duration += max(step, 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
player->typing_timer = 15;
|
player->typing_timer = 15;
|
||||||
}
|
}
|
||||||
else if (player->typing_timer > 0)
|
else if (player->typing_timer > 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue