summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cgame/cg_draw.c4
-rw-r--r--src/game/bg_public.h2
-rw-r--r--src/game/g_active.c8
-rw-r--r--src/game/g_buildable.c8
-rw-r--r--src/game/g_client.c2
-rw-r--r--src/game/g_cmds.c2
-rw-r--r--src/game/tremulous.h1
7 files changed, 13 insertions, 14 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 24b49747..ebdac7fd 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -378,7 +378,7 @@ static void CG_DrawPlayerStamina( int ownerDraw, rectDef_t *rect,
{
playerState_t *ps = &cg.snap->ps;
float stamina = ps->stats[ STAT_STAMINA ];
- float maxStaminaBy3 = (float)MAX_STAMINA / 3.0f;
+ float maxStaminaBy3 = (float)STAMINA_MAX / 3.0f;
float progress;
vec4_t color;
@@ -394,7 +394,7 @@ static void CG_DrawPlayerStamina( int ownerDraw, rectDef_t *rect,
progress = stamina / maxStaminaBy3;
break;
case CG_PLAYER_STAMINA_4:
- progress = ( stamina + MAX_STAMINA ) / MAX_STAMINA;
+ progress = ( stamina + STAMINA_MAX ) / STAMINA_MAX;
break;
default:
return;
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 2fed12e1..912e2d39 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -246,8 +246,6 @@ typedef enum
#define SB_VALID_TOGGLEBIT 0x00004000
-#define MAX_STAMINA 1000
-
// player_state->persistant[] indexes
// these fields are the only part of player_state that isn't
// cleared on respawn
diff --git a/src/game/g_active.c b/src/game/g_active.c
index 2c4b443a..543cd4a4 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -608,10 +608,10 @@ void ClientTimerActions( gentity_t *ent, int msec )
client->ps.stats[ STAT_STAMINA ] += STAMINA_WALK_RESTORE;
// Check stamina limits
- if( client->ps.stats[ STAT_STAMINA ] > MAX_STAMINA )
- client->ps.stats[ STAT_STAMINA ] = MAX_STAMINA;
- else if( client->ps.stats[ STAT_STAMINA ] < -MAX_STAMINA )
- client->ps.stats[ STAT_STAMINA ] = -MAX_STAMINA;
+ if( client->ps.stats[ STAT_STAMINA ] > STAMINA_MAX )
+ client->ps.stats[ STAT_STAMINA ] = STAMINA_MAX;
+ else if( client->ps.stats[ STAT_STAMINA ] < -STAMINA_MAX )
+ client->ps.stats[ STAT_STAMINA ] = -STAMINA_MAX;
if( weapon == WP_ABUILD || weapon == WP_ABUILD2 ||
BG_InventoryContainsWeapon( WP_HBUILD, client->ps.stats ) )
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 574a951a..6317cbdf 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -2278,7 +2278,7 @@ void HMedistat_Think( gentity_t *self )
if( player->client && player->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
{
if( ( player->health < player->client->ps.stats[ STAT_MAX_HEALTH ] ||
- player->client->ps.stats[ STAT_STAMINA ] < MAX_STAMINA ) &&
+ player->client->ps.stats[ STAT_STAMINA ] < STAMINA_MAX ) &&
PM_Live( player->client->ps.pm_type ) )
{
self->enemy = player;
@@ -2307,11 +2307,11 @@ void HMedistat_Think( gentity_t *self )
}
else if( self->enemy && self->enemy->client ) //heal!
{
- if( self->enemy->client->ps.stats[ STAT_STAMINA ] < MAX_STAMINA )
+ if( self->enemy->client->ps.stats[ STAT_STAMINA ] < STAMINA_MAX )
self->enemy->client->ps.stats[ STAT_STAMINA ] += STAMINA_MEDISTAT_RESTORE;
- if( self->enemy->client->ps.stats[ STAT_STAMINA ] > MAX_STAMINA )
- self->enemy->client->ps.stats[ STAT_STAMINA ] = MAX_STAMINA;
+ if( self->enemy->client->ps.stats[ STAT_STAMINA ] > STAMINA_MAX )
+ self->enemy->client->ps.stats[ STAT_STAMINA ] = STAMINA_MAX;
self->enemy->health++;
diff --git a/src/game/g_client.c b/src/game/g_client.c
index d8858de9..f3426d42 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -1563,7 +1563,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles
for( i = 0; i < MAX_CLIENTS; i++ )
ent->credits[ i ] = 0;
- client->ps.stats[ STAT_STAMINA ] = MAX_STAMINA;
+ client->ps.stats[ STAT_STAMINA ] = STAMINA_MAX;
G_SetOrigin( ent, spawn_origin );
VectorCopy( spawn_origin, client->ps.origin );
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 6ee9bf7b..4c3067ed 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -374,7 +374,7 @@ void Cmd_Give_f( gentity_t *ent )
}
if( give_all || Q_stricmp( name, "stamina" ) == 0 )
- ent->client->ps.stats[ STAT_STAMINA ] = MAX_STAMINA;
+ ent->client->ps.stats[ STAT_STAMINA ] = STAMINA_MAX;
if( Q_stricmp( name, "poison" ) == 0 )
{
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index a7b3ba64..dda90f64 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -638,6 +638,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define STAMINA_SPRINT_TAKE 8
#define STAMINA_JUMP_TAKE 250
#define STAMINA_DODGE_TAKE 250
+#define STAMINA_MAX 1000
#define STAMINA_BREATHING_LEVEL 0
#define STAMINA_SLOW_LEVEL -500
#define STAMINA_BLACKOUT_LEVEL -800