diff options
author | Tim Angus <tim@ngus.net> | 2004-01-15 03:14:16 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2004-01-15 03:14:16 +0000 |
commit | 847db87d7a1be6425646a59fe583134ffb513510 (patch) | |
tree | f4589b50a7195bb1ce24a5cdf2bd3be4d81d29a3 | |
parent | c61e168ffb6e3ad28ac7e126ba9ff076984daa27 (diff) |
* Fixed physics bug where movers would displace buildables
* Light flares are now occluded by the player in 3rd person mode
* Setting s_initsound 0 no longer causes the weapon.cfg loader to complain
* Limited viewangles to +/-90 degrees when grabbed
-rw-r--r-- | src/cgame/cg_ents.c | 16 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 3 | ||||
-rw-r--r-- | src/cgame/cg_predict.c | 20 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 15 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 9 | ||||
-rw-r--r-- | src/game/g_active.c | 4 | ||||
-rw-r--r-- | src/game/g_mover.c | 5 |
7 files changed, 45 insertions, 27 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index b56a1a40..682d8aad 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -549,9 +549,15 @@ static void CG_LightFlare( centity_t *cent ) float maxAngle; vec3_t mins, maxs, start, end; float srcRadius, srLocal, ratio = 1.0f; + int entityNum; es = ¢->currentState; + if( cg.renderingThirdPerson ) + entityNum = MAGIC_TRACE_HACK; + else + entityNum = cg.predictedPlayerState.clientNum; + //don't draw light flares if( cg_lightFlare.integer == FLARE_OFF ) return; @@ -561,7 +567,7 @@ static void CG_LightFlare( centity_t *cent ) return; CG_Trace( &tr, cg.refdef.vieworg, NULL, NULL, es->angles2, - cg.predictedPlayerState.clientNum, MASK_SHOT ); + entityNum, MASK_SHOT ); //if there is no los between the view and the flare source //it definately cannot be seen @@ -636,7 +642,7 @@ static void CG_LightFlare( centity_t *cent ) srLocal += RADIUSSTEP; SETBOUNDS( mins, maxs, srLocal ); CG_Trace( &tr, start, mins, maxs, end, - cg.predictedPlayerState.clientNum, MASK_SHOT ); + entityNum, MASK_SHOT ); } while( ( tr.fraction == 1.0f && !tr.startsolid ) && ( srLocal < srcRadius ) ); @@ -647,7 +653,7 @@ static void CG_LightFlare( centity_t *cent ) { SETBOUNDS( mins, maxs, srLocal ); CG_Trace( &tr, start, mins, maxs, end, - cg.predictedPlayerState.clientNum, MASK_SHOT ); + entityNum, MASK_SHOT ); srLocal -= RADIUSSTEP; } while( ( tr.fraction < 1.0f || tr.startsolid ) && ( srLocal > 0.0f ) ); @@ -661,7 +667,7 @@ static void CG_LightFlare( centity_t *cent ) //draw timed flares SETBOUNDS( mins, maxs, srcRadius ); CG_Trace( &tr, start, mins, maxs, end, - cg.predictedPlayerState.clientNum, MASK_SHOT ); + entityNum, MASK_SHOT ); if( ( tr.fraction < 1.0f || tr.startsolid ) && cent->lfs.status ) { @@ -698,7 +704,7 @@ static void CG_LightFlare( centity_t *cent ) //draw nofade flares SETBOUNDS( mins, maxs, srcRadius ); CG_Trace( &tr, start, mins, maxs, end, - cg.predictedPlayerState.clientNum, MASK_SHOT ); + entityNum, MASK_SHOT ); //flare source occluded if( ( tr.fraction < 1.0f || tr.startsolid ) ) diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 14527607..ccd8789e 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1562,6 +1562,9 @@ void CG_ModelDoor( centity_t *cent ); // // cg_predict.c // + +#define MAGIC_TRACE_HACK -2 + void CG_BuildSolidList( void ); int CG_PointContents( const vec3_t point, int passEntityNum ); void CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c index a8285306..a68d58f6 100644 --- a/src/cgame/cg_predict.c +++ b/src/cgame/cg_predict.c @@ -81,7 +81,7 @@ CG_ClipMoveToEntities static void CG_ClipMoveToEntities ( const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int skipNumber, int mask, trace_t *tr, qboolean capsule ) { - int i, x, zd, zu; + int i, j, x, zd, zu; trace_t trace; entityState_t *ent; clipHandle_t cmodel; @@ -89,9 +89,20 @@ static void CG_ClipMoveToEntities ( const vec3_t start, const vec3_t mins, const vec3_t origin, angles; centity_t *cent; - for( i = 0; i < cg_numSolidEntities; i++ ) + //SUPAR HACK + //this causes a trace to collide with the local player + if( skipNumber == MAGIC_TRACE_HACK ) + j = cg_numSolidEntities + 1; + else + j = cg_numSolidEntities; + + for( i = 0; i < j; i++ ) { - cent = cg_solidEntities[ i ]; + if( i < cg_numSolidEntities ) + cent = cg_solidEntities[ i ]; + else + cent = &cg.predictedPlayerEntity; + ent = ¢->currentState; if( ent->number == skipNumber ) @@ -116,6 +127,9 @@ static void CG_ClipMoveToEntities ( const vec3_t start, const vec3_t mins, const bmins[ 2 ] = -zd; bmaxs[ 2 ] = zu; + if( i == cg_numSolidEntities ) + BG_FindBBoxForClass( ( ent->powerups >> 8 ) & 0xFF, bmins, bmaxs, NULL, NULL, NULL ); + cmodel = trap_CM_TempBoxModel( bmins, bmaxs ); VectorCopy( vec3_origin, angles ); VectorCopy( cent->lerpOrigin, origin ); diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 9af1a76b..cdd77d47 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -445,9 +445,6 @@ static qboolean CG_ParseWeaponModeSection( weaponInfoMode_t *wim, char **text_p wim->impactSound[ index ] = trap_S_RegisterSound( token, qfalse ); - if( !wim->impactSound[ index ] ) - CG_Printf( S_COLOR_RED "ERROR: impact sound %d not found %s\n", index, token ); - continue; } else if( !Q_stricmp( token, "impactDlightColor" ) ) @@ -543,9 +540,6 @@ static qboolean CG_ParseWeaponModeSection( weaponInfoMode_t *wim, char **text_p wim->firingSound = trap_S_RegisterSound( token, qfalse ); - if( !wim->firingSound ) - CG_Printf( S_COLOR_RED "ERROR: firing sound not found %s\n", token ); - continue; } else if( !Q_stricmp( token, "missileSound" ) ) @@ -556,9 +550,6 @@ static qboolean CG_ParseWeaponModeSection( weaponInfoMode_t *wim, char **text_p wim->missileSound = trap_S_RegisterSound( token, qfalse ); - if( !wim->missileSound ) - CG_Printf( S_COLOR_RED "ERROR: missile sound not found %s\n", token ); - continue; } else if( !Q_stricmp( token, "flashSound" ) ) @@ -582,9 +573,6 @@ static qboolean CG_ParseWeaponModeSection( weaponInfoMode_t *wim, char **text_p wim->flashSound[ index ] = trap_S_RegisterSound( token, qfalse ); - if( !wim->flashSound[ index ] ) - CG_Printf( S_COLOR_RED "ERROR: flash sound %d not found %s\n", index, token ); - continue; } else if( !Q_stricmp( token, "}" ) ) @@ -720,9 +708,6 @@ static qboolean CG_ParseWeaponFile( const char *filename, weaponInfo_t *wi ) wi->readySound = trap_S_RegisterSound( token, qfalse ); - if( !wi->readySound ) - CG_Printf( S_COLOR_RED "ERROR: weapon idle sound not found %s\n", token ); - continue; } else if( !Q_stricmp( token, "icon" ) ) diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index c9a57fc0..a6b8a63b 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -3110,9 +3110,14 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) while( diff < -180.0f ) diff += 360.0f; - if( diff < 0 ) + if( diff < -90.0f ) + ps->delta_angles[ i ] += ANGLE2SHORT( fabs( diff ) - 90.0f ); + else if( diff > 90.0f ) + ps->delta_angles[ i ] -= ANGLE2SHORT( fabs( diff ) - 90.0f ); + + if( diff < 0.0f ) ps->delta_angles[ i ] += ANGLE2SHORT( fabs( diff ) * 0.05f ); - else if( diff > 0 ) + else if( diff > 0.0f ) ps->delta_angles[ i ] -= ANGLE2SHORT( fabs( diff ) * 0.05f ); } } diff --git a/src/game/g_active.c b/src/game/g_active.c index 21ff144e..90136f11 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -496,7 +496,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) if( client->ps.weapon == WP_BIGMOFO ) { if( client->ps.stats[ STAT_MISC ] < BMOFO_CHARGE_TIME && ucmd->buttons & BUTTON_ATTACK2 && - ( ucmd->forwardmove > 0 || aRight ) ) + ( ucmd->forwardmove > 0 ) ) { client->charging = qfalse; //should already be off, just making sure @@ -514,7 +514,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) client->charging = qtrue; //if the charger has stopped moving take a chunk of charge away - if( VectorLength( client->ps.velocity ) < 64.0f ) + if( VectorLength( client->ps.velocity ) < 64.0f || aRight ) client->ps.stats[ STAT_MISC ] = client->ps.stats[ STAT_MISC ] >> 1; //can't charge backwards diff --git a/src/game/g_mover.c b/src/game/g_mover.c index 3d171343..3bc4e94b 100644 --- a/src/game/g_mover.c +++ b/src/game/g_mover.c @@ -129,6 +129,11 @@ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, v check->s.groundEntityNum != pusher->s.number ) return qfalse; + //don't try to move buildables unless standing on a mover + if( check->s.eType == ET_BUILDABLE && + check->s.groundEntityNum != pusher->s.number ) + return qfalse; + // save off the old position if( pushed_p > &pushed[ MAX_GENTITIES ] ) G_Error( "pushed_p > &pushed[MAX_GENTITIES]" ); |