From 92d11da8a577f08b55e1d057b43fc362296f18a3 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 3 Nov 2010 02:07:56 +0000 Subject: [PATCH] - Revised usage of jumpTics. In Hexen, it went like this: * When you jump, it gets set to 18. * When you land, it gets set to 7. * As long as it is non-zero, it counts down, and you cannot jump. Of note here, is that setting it to 18 upon jumping seems useless, since you can't jump unless you're on the ground, and when you reach the ground, it will always be set to 7. With that in mind, the new behavior is: * When you jump, it gets set to -1. * When you land, if it is less than zero or you fall far enough to squat, jumpTics will be set to 7. Otherwise, jumpTics is left alone. * If jumpTics is positive, it will count down each tic. * As long as JumpTics is non-zero, you cannot jump. SVN r2970 (trunk) --- src/p_mobj.cpp | 2 +- src/p_user.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 71e0a2512..b614a25f2 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -2253,7 +2253,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) mo->HitFloor (); if (mo->player) { - if (mo->player->jumpTics != 0 && mo->velz < -grav*4) + if (mo->player->jumpTics < 0 || mo->velz < minvel) { // delay any jumping for a short while mo->player->jumpTics = 7; } diff --git a/src/p_user.cpp b/src/p_user.cpp index e844d2680..f80ddb9ae 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -2156,7 +2156,7 @@ void P_PlayerThink (player_t *player) P_DeathThink (player); return; } - if (player->jumpTics) + if (player->jumpTics > 0) { player->jumpTics--; } @@ -2217,7 +2217,7 @@ void P_PlayerThink (player_t *player) // [RH] check for jump if (cmd->ucmd.buttons & BT_JUMP) { - if (player->crouchoffset!=0) + if (player->crouchoffset != 0) { // Jumping while crouching will force an un-crouch but not jump player->crouching = 1; @@ -2231,7 +2231,7 @@ void P_PlayerThink (player_t *player) { player->mo->velz = 3*FRACUNIT; } - else if (level.IsJumpingAllowed() && onground && !player->jumpTics) + else if (level.IsJumpingAllowed() && onground && player->jumpTics == 0) { fixed_t jumpvelz = player->mo->JumpZ * 35 / TICRATE; @@ -2241,7 +2241,7 @@ void P_PlayerThink (player_t *player) player->mo->velz += jumpvelz; S_Sound (player->mo, CHAN_BODY, "*jump", 1, ATTN_NORM); player->mo->flags2 &= ~MF2_ONMOBJ; - player->jumpTics = 18*TICRATE/35; + player->jumpTics = -1; } }