summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_event.c10
-rw-r--r--src/cgame/cg_view.c16
-rw-r--r--src/cgame/cg_weapons.c6
3 files changed, 16 insertions, 16 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index d5f30cb4..c8a3fab2 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -464,14 +464,14 @@ also called by CG_CheckPlayerstateEvents
#define DEBUGNAME(x) if(cg_debugEvents.integer){CG_Printf(x"\n");}
void CG_EntityEvent( centity_t *cent, vec3_t position ) {
entityState_t *es;
- int event;
- vec3_t dir;
+ int event;
+ vec3_t dir;
const char *s;
- int clientNum;
+ int clientNum;
clientInfo_t *ci;
- int steptime;
+ int steptime;
- BG_unpackAttributes( NULL, NULL, &steptime, cg.predictedPlayerState.stats );
+ steptime = BG_FindSteptimeForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] );
es = &cent->currentState;
event = es->event & ~EV_EVENT_BITS;
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index 7dabda68..d8401334 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -307,7 +307,7 @@ static void CG_StepOffset( void ) {
int timeDelta;
int steptime;
- BG_unpackAttributes( NULL, NULL, &steptime, cg.predictedPlayerState.stats );
+ steptime = BG_FindSteptimeForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] );
// smooth out stair climbing
timeDelta = cg.time - cg.stepTime;
@@ -331,9 +331,9 @@ static void CG_OffsetFirstPersonView( void ) {
float delta;
float speed;
float f;
- vec3_t predictedVelocity;
+ vec3_t predictedVelocity;
int timeDelta;
- int bob2;
+ float bob2;
if ( cg.snap->ps.pm_type == PM_INTERMISSION ) {
return;
@@ -389,17 +389,17 @@ static void CG_OffsetFirstPersonView( void ) {
// add angles based on bob
//TA: bob amount is class dependant
- BG_unpackAttributes( NULL, &bob2, NULL, cg.predictedPlayerState.stats );
+ bob2 = BG_FindBobForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] );
if( bob2 != 0 )
{
// make sure the bob is visible even at low speeds
speed = cg.xyspeed > 200 ? cg.xyspeed : 200;
- delta = cg.bobfracsin * ( bob2 / 1000.0 ) * speed;
+ delta = cg.bobfracsin * ( bob2 ) * speed;
if (cg.predictedPlayerState.pm_flags & PMF_DUCKED)
delta *= 3; // crouching
angles[PITCH] += delta;
- delta = cg.bobfracsin * ( bob2 / 1000.0 ) * speed;
+ delta = cg.bobfracsin * ( bob2 ) * speed;
if (cg.predictedPlayerState.pm_flags & PMF_DUCKED)
delta *= 3; // crouching accentuates roll
if (cg.bobcycle & 1)
@@ -530,7 +530,7 @@ static int CG_CalcFov( void ) {
int a;
float b;
- BG_unpackAttributes( &attribFov, NULL, NULL, cg.predictedPlayerState.stats );
+ attribFov = BG_FindFovForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] );
if ( cg.predictedPlayerState.pm_type == PM_INTERMISSION ) {
// if in intermission, use a fixed value
@@ -555,7 +555,7 @@ static int CG_CalcFov( void ) {
zoomFov = attribFov;
//TA: only do all the zoom stuff if the client CAN zoom
- if( cg.predictedPlayerState.stats[ STAT_ABILITIES ] & SCA_CANZOOM )
+ if( BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_PCLASS ], SCA_CANZOOM ) )
{
if ( cg.zoomed )
{
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index 777271c3..15992501 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -692,7 +692,7 @@ static void CG_CalculateWeaponPosition( vec3_t origin, vec3_t angles ) {
float scale;
int delta;
float fracsin;
- int bob;
+ float bob;
VectorCopy( cg.refdef.vieworg, origin );
VectorCopy( cg.refdefViewAngles, angles );
@@ -706,7 +706,7 @@ static void CG_CalculateWeaponPosition( vec3_t origin, vec3_t angles ) {
// gun angles from bobbing
//TA: bob amount is class dependant
- BG_unpackAttributes( NULL, &bob, NULL, cg.predictedPlayerState.stats );
+ bob = BG_FindBobForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] );
if( bob != 0 )
{
angles[ROLL] += scale * cg.bobfracsin * 0.005;
@@ -715,7 +715,7 @@ static void CG_CalculateWeaponPosition( vec3_t origin, vec3_t angles ) {
}
// drop the weapon when landing
- if( !( cg.predictedPlayerState.stats[ STAT_ABILITIES ] & SCA_NOWEAPONDRIFT ) )
+ if( !BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_PCLASS ], SCA_NOWEAPONDRIFT ) )
{
delta = cg.time - cg.landTime;
if ( delta < LAND_DEFLECT_TIME )