Skip to content

Commit

Permalink
Some extra checks that was missing
Browse files Browse the repository at this point in the history
git-svn-id: http://oax.googlecode.com/svn/trunk@303 48ef5666-4144-11de-b6cc-f32266f7ba4a
  • Loading branch information
sago007@gmail.com committed Aug 30, 2012
1 parent 3a473dc commit 7112385
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion code/cgame/cg_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,6 @@ static void CG_PlayerAngles( centity_t *cent, vec3_t legs[3], vec3_t torso[3], v
}

//
clientNum = cent->currentState.clientNum;
if ( clientNum >= 0 && clientNum < MAX_CLIENTS ) {
ci = &cgs.clientinfo[ clientNum ];
if ( ci->fixedlegs ) {
Expand Down
6 changes: 3 additions & 3 deletions code/cgame/cg_snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ CG_TransitionEntity
cent->nextState is moved to cent->currentState and events are fired
===============
*/
//unlagged - early transitioning
//unlagged - early transitioning
// used to be static, now needed to transition entities from within cg_ents.c
void CG_TransitionEntity( centity_t *cent ) {
cent->currentState = cent->nextState;
Expand Down Expand Up @@ -234,12 +234,12 @@ static void CG_SetNextSnap( snapshot_t *snap ) {
}

// if changing follow mode, don't interpolate
if ( cg.nextSnap->ps.clientNum != cg.snap->ps.clientNum ) {
if ( cg.snap && cg.nextSnap->ps.clientNum != cg.snap->ps.clientNum ) {
cg.nextFrameTeleport = qtrue;
}

// if changing server restarts, don't interpolate
if ( ( cg.nextSnap->snapFlags ^ cg.snap->snapFlags ) & SNAPFLAG_SERVERCOUNT ) {
if ( cg.snap && ( ( cg.nextSnap->snapFlags ^ cg.snap->snapFlags ) & SNAPFLAG_SERVERCOUNT ) ) {
cg.nextFrameTeleport = qtrue;
}

Expand Down
4 changes: 2 additions & 2 deletions code/cgame/cg_weapons.c
Original file line number Diff line number Diff line change
Expand Up @@ -3036,14 +3036,14 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
}
}
#endif
r = rand() & 3;
/*r = rand() & 3;
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}*/

radius = 8;
break;
Expand Down
2 changes: 1 addition & 1 deletion code/game/g_combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
int i,counter2;
char *killerName, *obit;

if ( self->client->ps.pm_type == PM_DEAD ) {
if ( !(self->client) || (self->client->ps.pm_type == PM_DEAD) ) {
return;
}

Expand Down
3 changes: 2 additions & 1 deletion code/game/g_missile.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,8 @@ gentity_t *fire_grapple (gentity_t *self, vec3_t start, vec3_t dir) {
SnapVector( hook->s.pos.trDelta ); // save net bandwidth
VectorCopy (start, hook->r.currentOrigin);

self->client->hook = hook;
if(self->client)
self->client->hook = hook;

return hook;
}
Expand Down
2 changes: 1 addition & 1 deletion code/ui/ui_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ float Item_Slider_ThumbPosition(itemDef_t *item) {
x = item->window.rect.x;
}

if (editDef == NULL && item->cvar) {
if ( !editDef || !(item->cvar) ) {
return x;
}

Expand Down

0 comments on commit 7112385

Please sign in to comment.