diff options
author | Asa Kravets <norfenstein@gmail.com> | 2010-01-03 17:25:23 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:17:25 +0000 |
commit | eba0177930cac4c1935571654911cc3264328ddc (patch) | |
tree | 6a16d3568de27aff5134e2dcd8115c04958dec3a /src/game | |
parent | a7389070c1c77ed83d8f3c850267e2bc8b398209 (diff) |
* Renamed MAX_STAMINA to STAMINA_MAX and moved to tremulous.h
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_public.h | 2 | ||||
-rw-r--r-- | src/game/g_active.c | 8 | ||||
-rw-r--r-- | src/game/g_buildable.c | 8 | ||||
-rw-r--r-- | src/game/g_client.c | 2 | ||||
-rw-r--r-- | src/game/g_cmds.c | 2 | ||||
-rw-r--r-- | src/game/tremulous.h | 1 |
6 files changed, 11 insertions, 12 deletions
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 |