diff options
author | Tim Angus <tim@ngus.net> | 2001-02-05 03:14:44 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-02-05 03:14:44 +0000 |
commit | 96d1e6700762377bbfe54f30422ee0f532bea275 (patch) | |
tree | c4e311216bb70d2ad4a3f818250d97f62a3c3989 /src/cgame | |
parent | 76c534a0ef5d3d7ce318757d4be4675a9c63e8ae (diff) |
Significantly reogranised how class properties are propogated between client/server. Started on Droid infest mechanism.
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_event.c | 10 | ||||
-rw-r--r-- | src/cgame/cg_view.c | 16 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 6 |
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 = ¢->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 ) |