summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Millwood <thebenmachine@gmail.com>2009-10-03 11:20:45 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:14:54 +0000
commit8a36ffb80b9ee398a6b21f6e1f937f2527ae9cce (patch)
treee5836244070184bdf32f50511fc0e60b762efe8c
parent44444b6d0dd3d5fbe04eb259f196021e370bdcf4 (diff)
Shut up compiler warnings (and possible bugfix)
-rw-r--r--src/game/bg_local.h2
-rw-r--r--src/game/g_buildable.c1
-rw-r--r--src/game/g_combat.c5
-rw-r--r--src/game/g_weapon.c25
4 files changed, 15 insertions, 18 deletions
diff --git a/src/game/bg_local.h b/src/game/bg_local.h
index 4c582266..354214c9 100644
--- a/src/game/bg_local.h
+++ b/src/game/bg_local.h
@@ -86,5 +86,3 @@ qboolean PM_SlideMove( qboolean gravity );
void PM_StepEvent( vec3_t from, vec3_t to, vec3_t normal );
qboolean PM_StepSlideMove( qboolean gravity, qboolean predictive );
qboolean PM_PredictStepMove( void );
-
-void PM_StartTorsoAnim( int anim );
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 3420b5b0..ec3c76fd 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -2090,7 +2090,6 @@ qboolean HMGTurret_CheckTarget( gentity_t *self, gentity_t *target,
qboolean los_check )
{
trace_t tr;
- gentity_t *traceEnt;
vec3_t dir, end;
if( !target || target->health <= 0 || !target->client ||
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 46536c87..c674d1da 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -135,7 +135,7 @@ Returns the total damage dealt.
*/
float G_RewardAttackers( gentity_t *self )
{
- float value, totalDamage;
+ float value, totalDamage = 0;
int team, i;
// Total up all the damage done by every client
@@ -185,10 +185,9 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
gentity_t *ent;
int anim;
int killer;
- int i, j;
+ int i;
char *killerName, *obit;
float totalDamage = 0.0f;
- gentity_t *player;
if( self->client->ps.pm_type == PM_DEAD )
return;
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 2f3b6fd1..1955ec6d 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -37,22 +37,23 @@ G_ForceWeaponChange
void G_ForceWeaponChange( gentity_t *ent, weapon_t weapon )
{
int i;
+ playerState_t *ps = &ent->client->ps;
if( !ent )
return;
// stop a reload in progress
- if( ent->client->ps.weaponstate == WEAPON_RELOADING )
+ if( ps->weaponstate == WEAPON_RELOADING )
{
- PM_StartTorsoAnim( TORSO_RAISE );
- ent->client->ps.weaponTime = 250;
- ent->client->ps.weaponstate = WEAPON_READY;
+ ps->torsoAnim = ( ( ps->torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | TORSO_RAISE;
+ ps->weaponTime = 250;
+ ps->weaponstate = WEAPON_READY;
}
- ent->client->ps.pm_flags |= PMF_WEAPON_SWITCH;
+ ps->pm_flags |= PMF_WEAPON_SWITCH;
if( weapon == WP_NONE ||
- !BG_InventoryContainsWeapon( weapon, ent->client->ps.stats ) )
+ !BG_InventoryContainsWeapon( weapon, ps->stats ) )
{
// switch to the first non blaster weapon
for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ )
@@ -60,24 +61,24 @@ void G_ForceWeaponChange( gentity_t *ent, weapon_t weapon )
if( i == WP_BLASTER )
continue;
- if( BG_InventoryContainsWeapon( i, ent->client->ps.stats ) )
+ if( BG_InventoryContainsWeapon( i, ps->stats ) )
{
- ent->client->ps.persistant[ PERS_NEWWEAPON ] = i;
+ ps->persistant[ PERS_NEWWEAPON ] = i;
break;
}
}
// only got the blaster to switch to
if( i == WP_NUM_WEAPONS )
- ent->client->ps.persistant[ PERS_NEWWEAPON ] = WP_BLASTER;
+ ps->persistant[ PERS_NEWWEAPON ] = WP_BLASTER;
}
else
- ent->client->ps.persistant[ PERS_NEWWEAPON ] = weapon;
+ ps->persistant[ PERS_NEWWEAPON ] = weapon;
// force this here to prevent flamer effect from continuing
- ent->client->ps.generic1 = WPM_NOTFIRING;
+ ps->generic1 = WPM_NOTFIRING;
- ent->client->ps.weapon = ent->client->ps.persistant[ PERS_NEWWEAPON ];
+ ps->weapon = ent->client->ps.persistant[ PERS_NEWWEAPON ];
}
/*