summaryrefslogtreecommitdiff
path: root/src/game/g_active.c
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-24 07:46:20 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:03 +0000
commit6717b6d4f7882081012550719dd4373650fdd033 (patch)
tree25c36abd50a03055e084850db384a976c7384f1b /src/game/g_active.c
parent3c596928698f25af8e0fe45403a5770eac3866d1 (diff)
* Stamina changes/fixes (kevlarman)
- Restore blacking out when you run out of stamina - Add cg_sprintToggle, allowing the sprint button to act as a toggle between always-sprinting or not - Walk overrides sprint, by popular demand - Modify the stamina "bolt" to better differentiate between states - Allow one to begin a sprint when stamina is negative (even though it is generally a bad idea for them, at least their button presses do something!) * When avilable, use predictedplayerstate for cg_drawSpeed to reduce latency (kevlarman)
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r--src/game/g_active.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c
index 236bc708..4bd1c30e 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -596,8 +596,9 @@ void ClientTimerActions( gentity_t *ent, int msec )
// Restore or subtract stamina
if( stopped || client->ps.pm_type == PM_JETPACK )
client->ps.stats[ STAT_STAMINA ] += STAMINA_STOP_RESTORE;
- else if( client->ps.stats[ STAT_STATE ] & SS_SPEEDBOOST )
- client->ps.stats[ STAT_STAMINA ] -= STAMINA_SPRINT_TAKE;
+ else if( ( client->ps.stats[ STAT_STATE ] & SS_SPEEDBOOST ) &&
+ !( client->buttons & BUTTON_WALKING ) ) // walk overrides sprint
+ client->ps.stats[ STAT_STAMINA ] -= STAMINA_SPRINT_TAKE;
else if( walking || crouched )
client->ps.stats[ STAT_STAMINA ] += STAMINA_WALK_RESTORE;