summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Tetelman <kevlarman@gmail.com>2009-10-03 12:59:19 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:23 +0000
commit089dca871b4069ef4a9e976c09573405043eff65 (patch)
treec860f131874045e0a746ffb8b0204b3a7b090b81 /src
parent5232654139a3f2f5916fc63c998076e1ca6bd443 (diff)
* separate dodge and sprint onto their own keys (dodge +button6, sprint +button8)
* hold the sprint key to move faster * FIXME: remove references to SS_SPEEDBOOST and cg_alwayssprint
Diffstat (limited to 'src')
-rw-r--r--src/game/bg_pmove.c20
-rw-r--r--src/qcommon/q_shared.h1
2 files changed, 6 insertions, 15 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index c876b777..9a3cfe97 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -383,7 +383,7 @@ static float PM_CmdScale( usercmd_t *cmd )
if( pm->ps->stats[ STAT_TEAM ] == TEAM_HUMANS && pm->ps->pm_type == PM_NORMAL )
{
- if( pm->ps->stats[ STAT_STATE ] & SS_SPEEDBOOST )
+ if( cmd->buttons & BUTTON_SPRINT )
modifier *= HUMAN_SPRINT_MODIFIER;
else
modifier *= HUMAN_JOG_MODIFIER;
@@ -892,6 +892,7 @@ static qboolean PM_CheckWaterJump( void )
return qtrue;
}
+
/*
==================
PM_CheckDodge
@@ -916,26 +917,14 @@ static qboolean PM_CheckDodge( void )
pm->ps->pm_time = HUMAN_DODGE_TIMEOUT;
}
- // Reasons to stop a sprint
- if( pm->cmd.forwardmove <= 0 || pm->cmd.upmove < 0 ||
- pm->ps->pm_type != PM_NORMAL || pm->cmd.buttons & BUTTON_WALKING )
- pm->ps->stats[ STAT_STATE ] &= ~SS_SPEEDBOOST;
-
// Reasons why we can't start a dodge or sprint
if( pm->ps->pm_type != PM_NORMAL || pm->ps->stats[ STAT_STAMINA ] < 0 ||
( pm->ps->pm_flags & PMF_CROUCH_HELD ) )
return qfalse;
- // Start a sprint instead of forward leaps
- if( pm->cmd.forwardmove > 0 &&
- ( ( pm->cmd.buttons & BUTTON_DODGE ) ||
- ( pm->ps->persistant[ PERS_STATE ] & PS_ALWAYSSPRINT ) ) )
- {
- if( pm->cmd.buttons & BUTTON_WALKING )
- return qfalse;
- pm->ps->stats[ STAT_STATE ] |= SS_SPEEDBOOST;
+ // Can't dodge forward
+ if( pm->cmd.forwardmove > 0 )
return qfalse;
- }
// Reasons why we can't start a dodge only
if( pm->ps->pm_flags & ( PMF_TIME_LAND | PMF_CHARGE ) ||
@@ -946,6 +935,7 @@ static qboolean PM_CheckDodge( void )
// Dodge direction specified with movement keys
if( ( !pm->cmd.rightmove && !pm->cmd.forwardmove ) || pm->cmd.upmove )
return qfalse;
+
AngleVectors( pm->ps->viewangles, NULL, right, NULL );
forward[ 0 ] = -right[ 1 ];
forward[ 1 ] = right[ 0 ];
diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h
index 18b8c6d7..dc1d2058 100644
--- a/src/qcommon/q_shared.h
+++ b/src/qcommon/q_shared.h
@@ -1156,6 +1156,7 @@ typedef struct playerState_s {
#define BUTTON_ATTACK2 32
#define BUTTON_DODGE 64 // start a dodge or sprint motion
#define BUTTON_USE_EVOLVE 128 // use target or open evolve menu
+#define BUTTON_SPRINT 256
#define BUTTON_ANY 2048 // any key whatsoever