diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_draw.c | 24 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 3 | ||||
-rw-r--r-- | src/cgame/cg_playerstate.c | 10 | ||||
-rw-r--r-- | src/cgame/cg_predict.c | 6 | ||||
-rw-r--r-- | src/cgame/cg_view.c | 9 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 2 | ||||
-rw-r--r-- | src/game/bg_slidemove.c | 4 | ||||
-rw-r--r-- | src/game/g_active.c | 18 | ||||
-rw-r--r-- | src/game/g_main.c | 3 | ||||
-rw-r--r-- | src/qcommon/q_shared.c | 3 | ||||
-rw-r--r-- | src/ui/ui_gameinfo.c | 5 | ||||
-rw-r--r-- | src/ui/ui_main.c | 10 | ||||
-rw-r--r-- | src/ui/ui_shared.c | 23 |
13 files changed, 12 insertions, 108 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 7268ec64..cc3ab830 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -503,13 +503,10 @@ static void CG_DrawPlayerBuildTimerRing( rectDef_t *rect, vec4_t backColor, vec4_t foreColor, qhandle_t shader ) { playerState_t *ps = &cg.snap->ps; - centity_t *cent; float buildTime = ps->stats[ STAT_MISC ]; float progress; vec4_t color; - cent = &cg_entities[ cg.snap->ps.clientNum ]; - if( buildTime > MAXIMUM_BUILD_TIME ) buildTime = MAXIMUM_BUILD_TIME; @@ -1276,11 +1273,9 @@ void CG_DrawLoadingScreen( void ) float CG_GetValue( int ownerDraw ) { - centity_t *cent; playerState_t *ps; weapon_t weapon; - cent = &cg_entities[ cg.snap->ps.clientNum ]; ps = &cg.snap->ps; weapon = BG_GetPlayerWeapon( ps ); @@ -1926,12 +1921,11 @@ static void CG_DrawClock( rectDef_t *rect, float text_x, float text_y, int i, strLength; float w, h, totalWidth; qtime_t qt; - int t; if( !cg_drawClock.integer ) return; - t = trap_RealTime( &qt ); + trap_RealTime( &qt ); if( cg_drawClock.integer == 2 ) { @@ -2455,11 +2449,9 @@ CG_DrawWeaponIcon void CG_DrawWeaponIcon( rectDef_t *rect, vec4_t color ) { int maxAmmo; - centity_t *cent; playerState_t *ps; weapon_t weapon; - cent = &cg_entities[ cg.snap->ps.clientNum ]; ps = &cg.snap->ps; weapon = BG_GetPlayerWeapon( ps ); @@ -3067,10 +3059,6 @@ CG_DrawLighting */ static void CG_DrawLighting( void ) { - centity_t *cent; - - cent = &cg_entities[ cg.snap->ps.clientNum ]; - //fade to black if stamina is low if( ( cg.snap->ps.stats[ STAT_STAMINA ] < STAMINA_BLACKOUT_LEVEL ) && ( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) ) @@ -3257,7 +3245,6 @@ static void CG_DrawVote( team_t team ) static qboolean CG_DrawScoreboard( void ) { static qboolean firstTime = qtrue; - float fade, *fadeColor; if( menuScoreboard ) menuScoreboard->window.flags &= ~WINDOW_FORCED; @@ -3269,13 +3256,8 @@ static qboolean CG_DrawScoreboard( void ) return qfalse; } - if( cg.showScores || - cg.predictedPlayerState.pm_type == PM_INTERMISSION ) - { - fade = 1.0; - fadeColor = colorWhite; - } - else + if( !cg.showScores && + cg.predictedPlayerState.pm_type != PM_INTERMISSION ) { cg.deferredPlayerLoading = 0; cg.killerName[ 0 ] = 0; diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 7b27579a..9f9dbaee 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -836,7 +836,7 @@ void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int { centity_t *cent; vec3_t oldOrigin, origin, deltaOrigin; - vec3_t oldAngles, angles, deltaAngles; + vec3_t oldAngles, angles; if( moverNum <= 0 || moverNum >= ENTITYNUM_MAX_NORMAL ) { @@ -859,7 +859,6 @@ void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int BG_EvaluateTrajectory( ¢->currentState.apos, toTime, angles ); VectorSubtract( origin, oldOrigin, deltaOrigin ); - VectorSubtract( angles, oldAngles, deltaAngles ); VectorAdd( in, deltaOrigin, out ); diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c index 8a8e739c..9d31b4ab 100644 --- a/src/cgame/cg_playerstate.c +++ b/src/cgame/cg_playerstate.c @@ -245,8 +245,6 @@ CG_CheckLocalSounds */ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) { - int reward; - // don't play the sounds if the player just spawned if( ps->persistant[ PERS_SPECSTATE ] != ops->persistant[ PERS_SPECSTATE ] ) return; @@ -257,14 +255,6 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) if( ps->stats[ STAT_HEALTH ] > 0 ) CG_PainEvent( &cg.predictedPlayerEntity, ps->stats[ STAT_HEALTH ] ); } - - - // if we are going into the intermission, don't start any voices - if( cg.intermissionStarted ) - return; - - // reward sounds - reward = qfalse; } diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c index fa697e03..f3ae38ef 100644 --- a/src/cgame/cg_predict.c +++ b/src/cgame/cg_predict.c @@ -544,7 +544,6 @@ void CG_PredictPlayerState( void ) { int cmdNum, current, i; playerState_t oldPlayerState; - qboolean moved; usercmd_t oldestCmd; usercmd_t latestCmd; int stateIndex = 0, predictCmd = 0; @@ -730,9 +729,6 @@ void CG_PredictPlayerState( void ) stateIndex = cg.stateHead; } - // run cmds - moved = qfalse; - for( cmdNum = current - CMD_BACKUP + 1; cmdNum <= current; cmdNum++ ) { // get the command @@ -850,8 +846,6 @@ void CG_PredictPlayerState( void ) stateIndex = ( stateIndex + 1 ) % NUM_SAVED_STATES; } - moved = qtrue; - // add push trigger movement effects CG_TouchTriggerPrediction( ); diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index 823287d8..800a16ae 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -556,7 +556,7 @@ void CG_OffsetFirstPersonView( void ) vec3_t predictedVelocity; int timeDelta; float bob2; - vec3_t normal, baseOrigin; + vec3_t normal; playerState_t *ps = &cg.predictedPlayerState; BG_GetClientNormal( ps, normal ); @@ -567,8 +567,6 @@ void CG_OffsetFirstPersonView( void ) origin = cg.refdef.vieworg; angles = cg.refdefViewAngles; - VectorCopy( origin, baseOrigin ); - // if dead, fix the angle and don't add any kick if( cg.snap->ps.stats[ STAT_HEALTH ] <= 0 ) { @@ -696,7 +694,6 @@ void CG_OffsetFirstPersonView( void ) usercmd_t cmd; int cmdNum; float fFraction, rFraction, uFraction; - float fFraction2, rFraction2, uFraction2; cmdNum = trap_GetCurrentCmdNumber(); trap_GetUserCmd( cmdNum, &cmd ); @@ -714,10 +711,6 @@ void CG_OffsetFirstPersonView( void ) if( uFraction > 1.0f ) uFraction = 1.0f; - fFraction2 = -sin( fFraction * M_PI / 2 ); - rFraction2 = -sin( rFraction * M_PI / 2 ); - uFraction2 = -sin( uFraction * M_PI / 2 ); - if( cmd.forwardmove > 0 ) VectorMA( origin, STRUGGLE_DIST * fFraction, forward, origin ); else if( cmd.forwardmove < 0 ) diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 9fd6f04e..0d50e421 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -1395,10 +1395,8 @@ void CG_DrawItemSelect( rectDef_t *rect, vec4_t color ) int numItems = 0, selectedItem = 0; int length; qboolean vertical; - centity_t *cent; playerState_t *ps; - cent = &cg_entities[ cg.snap->ps.clientNum ]; ps = &cg.snap->ps; // don't display if dead diff --git a/src/game/bg_slidemove.c b/src/game/bg_slidemove.c index bd61401b..222d1f74 100644 --- a/src/game/bg_slidemove.c +++ b/src/game/bg_slidemove.c @@ -290,7 +290,6 @@ PM_StepSlideMove qboolean PM_StepSlideMove( qboolean gravity, qboolean predictive ) { vec3_t start_o, start_v; - vec3_t down_o, down_v; trace_t trace; vec3_t normal; vec3_t step_v, step_vNormal; @@ -331,9 +330,6 @@ qboolean PM_StepSlideMove( qboolean gravity, qboolean predictive ) return stepped; } - VectorCopy( pm->ps->origin, down_o ); - VectorCopy( pm->ps->velocity, down_v ); - VectorCopy( start_o, up ); VectorMA( up, STEPSIZE, normal, up ); diff --git a/src/game/g_active.c b/src/game/g_active.c index aad05967..5adfa847 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -387,7 +387,7 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) pmove_t pm; gclient_t *client; int clientNum; - qboolean attack1, attack3, following, queued; + qboolean attack1, following, queued; client = ent->client; @@ -396,8 +396,6 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) attack1 = ( client->buttons & BUTTON_ATTACK ) && !( client->oldbuttons & BUTTON_ATTACK ); - attack3 = ( client->buttons & BUTTON_USE_HOLDABLE ) && - !( client->oldbuttons & BUTTON_USE_HOLDABLE ); // We are in following mode only if we are following a non-spectating client following = client->sess.spectatorState == SPECTATOR_FOLLOW; @@ -565,8 +563,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) usercmd_t *ucmd; int aForward, aRight; qboolean walking = qfalse, stopped = qfalse, - crouched = qfalse, jumping = qfalse, - strafing = qfalse; + crouched = qfalse; int i; ucmd = &ent->client->pers.cmd; @@ -579,12 +576,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) else if( aForward <= 64 && aRight <= 64 ) walking = qtrue; - if( aRight > 0 ) - strafing = qtrue; - - if( ucmd->upmove > 0 ) - jumping = qtrue; - else if( ent->client->ps.pm_flags & PMF_DUCKED ) + if( ucmd->upmove <= 0 && ent->client->ps.pm_flags & PMF_DUCKED ) crouched = qtrue; client = ent->client; @@ -1828,16 +1820,12 @@ while a slow client may have multiple ClientEndFrame between ClientThink. */ void ClientEndFrame( gentity_t *ent ) { - clientPersistant_t *pers; - if( ent->client->sess.spectatorState != SPECTATOR_NOT ) { SpectatorClientEndFrame( ent ); return; } - pers = &ent->client->pers; - // // If the end of unit layout is displayed, don't give // the player any normal movement attributes diff --git a/src/game/g_main.c b/src/game/g_main.c index 2380a334..5d5fbed6 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -570,14 +570,13 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) { char serverinfo[ MAX_INFO_STRING ]; qtime_t qt; - int t; trap_GetServerinfo( serverinfo, sizeof( serverinfo ) ); G_LogPrintf( "------------------------------------------------------------\n" ); G_LogPrintf( "InitGame: %s\n", serverinfo ); - t = trap_RealTime( &qt ); + trap_RealTime( &qt ); G_LogPrintf("RealTime: %04i/%02i/%02i %02i:%02i:%02i\n", qt.tm_year+1900, qt.tm_mon+1, qt.tm_mday, qt.tm_hour, qt.tm_min, qt.tm_sec ); diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c index 8b13aba2..b4846799 100644 --- a/src/qcommon/q_shared.c +++ b/src/qcommon/q_shared.c @@ -707,12 +707,11 @@ char* Q_strrchr( const char* string, int c ) qboolean Q_isanumber( const char *s ) { char *p; - double d; if( *s == '\0' ) return qfalse; - d = strtod( s, &p ); + strtod( s, &p ); return *p == '\0'; } diff --git a/src/ui/ui_gameinfo.c b/src/ui/ui_gameinfo.c index 18a604b8..95c57c6f 100644 --- a/src/ui/ui_gameinfo.c +++ b/src/ui/ui_gameinfo.c @@ -169,7 +169,6 @@ void UI_LoadArenas( void ) char* dirptr; int i, n; int dirlen; - char *type; ui_numArenas = 0; uiInfo.mapCount = 0; @@ -193,10 +192,6 @@ void UI_LoadArenas( void ) for( n = 0; n < ui_numArenas; n++ ) { - // determine type - type = Info_ValueForKey( ui_arenaInfos[ n ], "type" ); - // if no type specified, it will be treated as "ffa" - uiInfo.mapList[uiInfo.mapCount].cinematic = -1; uiInfo.mapList[uiInfo.mapCount].mapLoadName = String_Alloc( Info_ValueForKey( ui_arenaInfos[n], "map" ) ); uiInfo.mapList[uiInfo.mapCount].mapName = String_Alloc( Info_ValueForKey( ui_arenaInfos[n], "longname" ) ); diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index eb96c4c5..73080627 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -1864,7 +1864,7 @@ UI_BuildPlayerList static void UI_BuildPlayerList( void ) { uiClientState_t cs; - int n, count, team, team2, playerTeamNumber; + int n, count, team, team2; char info[MAX_INFO_STRING]; trap_GetClientState( &cs ); @@ -1876,7 +1876,6 @@ static void UI_BuildPlayerList( void ) uiInfo.playerCount = 0; uiInfo.myTeamCount = 0; uiInfo.myPlayerIndex = 0; - playerTeamNumber = 0; for( n = 0; n < count; n++ ) { @@ -1909,9 +1908,6 @@ static void UI_BuildPlayerList( void ) Q_CleanStr( uiInfo.teamNames[uiInfo.myTeamCount] ); uiInfo.teamClientNums[uiInfo.myTeamCount] = n; - if( uiInfo.playerNumber == n ) - playerTeamNumber = uiInfo.myTeamCount; - uiInfo.myTeamCount++; } } @@ -4009,8 +4005,6 @@ UI_Init */ void UI_Init( qboolean inGameLoad ) { - int start; - BG_InitClassConfigs( ); BG_InitAllowedGameElements( ); @@ -4089,8 +4083,6 @@ void UI_Init( qboolean inGameLoad ) AssetCache(); - start = trap_Milliseconds(); - UI_LoadMenus( "ui/menus.txt", qtrue ); UI_LoadMenus( "ui/ingame.txt", qfalse ); UI_LoadMenus( "ui/tremulous.txt", qfalse ); diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 1cd922ad..b98127ce 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -2703,9 +2703,6 @@ int Item_ListBox_OverLB( itemDef_t *item, float x, float y ) { rectDef_t r; int thumbstart; - int count; - - count = DC->feederCount( item->feederID ); r.x = SCROLLBAR_SLIDER_X( item ); r.y = SCROLLBAR_Y( item ); @@ -3988,14 +3985,10 @@ void Menu_HandleKey( menuDef_t *menu, int key, qboolean down ) { int i; itemDef_t *item = NULL; - qboolean inHandler = qfalse; - - inHandler = qtrue; if( g_waitingForKey && down ) { Item_Bind_HandleKey( g_bindItem, key, down ); - inHandler = qfalse; return; } @@ -4006,7 +3999,6 @@ void Menu_HandleKey( menuDef_t *menu, int key, qboolean down ) g_editingField = qfalse; Item_RunScript( g_editItem, g_editItem->onTextEntry ); g_editItem = NULL; - inHandler = qfalse; return; } else @@ -4016,10 +4008,7 @@ void Menu_HandleKey( menuDef_t *menu, int key, qboolean down ) } if( menu == NULL ) - { - inHandler = qfalse; return; - } // see if the mouse is within the window bounds and if so is this a mouse click if( down && !( menu->window.flags & WINDOW_POPUP ) && @@ -4032,7 +4021,6 @@ void Menu_HandleKey( menuDef_t *menu, int key, qboolean down ) inHandleKey = qtrue; Menus_HandleOOBClick( menu, key, down ); inHandleKey = qfalse; - inHandler = qfalse; return; } } @@ -4054,16 +4042,12 @@ void Menu_HandleKey( menuDef_t *menu, int key, qboolean down ) if( Item_HandleKey( item, key, down ) ) { Item_Action( item ); - inHandler = qfalse; return; } } if( !down ) - { - inHandler = qfalse; return; - } // default handling switch( key ) @@ -4178,8 +4162,6 @@ void Menu_HandleKey( menuDef_t *menu, int key, qboolean down ) break; } - - inHandler = qfalse; } void ToWindowCoords( float *x, float *y, windowDef_t *window ) @@ -5129,12 +5111,10 @@ void BindingFromName( const char *cvar ) void Item_Slider_Paint( itemDef_t *item ) { vec4_t newColor; - float x, y, value; + float x, y; menuDef_t *parent = ( menuDef_t* )item->parent; float vScale = Item_Slider_VScale( item ); - value = ( item->cvar ) ? DC->getCVarValue( item->cvar ) : 0; - if( item->window.flags & WINDOW_HASFOCUS ) memcpy( newColor, &parent->focusColor, sizeof( vec4_t ) ); else @@ -5646,7 +5626,6 @@ void Item_OwnerDraw_Paint( itemDef_t *item ) if( DC->ownerDrawItem ) { vec4_t color, lowLight; - menuDef_t *parent = ( menuDef_t* )item->parent; Fade( &item->window.flags, &item->window.foreColor[3], parent->fadeClamp, &item->window.nextTime, parent->fadeCycle, qtrue, parent->fadeAmount ); memcpy( &color, &item->window.foreColor, sizeof( color ) ); |