mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-29 23:32:23 +00:00
Fix Coverity warning that endVelocity is uninitialized
This commit is contained in:
parent
c96acec428
commit
b511b8f2f6
1 changed files with 19 additions and 8 deletions
|
@ -158,8 +158,10 @@ qboolean PM_SlideMove( qboolean gravity ) {
|
||||||
// slide along the plane
|
// slide along the plane
|
||||||
PM_ClipVelocity (pm->ps->velocity, planes[i], clipVelocity, OVERCLIP );
|
PM_ClipVelocity (pm->ps->velocity, planes[i], clipVelocity, OVERCLIP );
|
||||||
|
|
||||||
// slide along the plane
|
if ( gravity ) {
|
||||||
PM_ClipVelocity (endVelocity, planes[i], endClipVelocity, OVERCLIP );
|
// slide along the plane
|
||||||
|
PM_ClipVelocity (endVelocity, planes[i], endClipVelocity, OVERCLIP );
|
||||||
|
}
|
||||||
|
|
||||||
// see if there is a second plane that the new move enters
|
// see if there is a second plane that the new move enters
|
||||||
for ( j = 0 ; j < numplanes ; j++ ) {
|
for ( j = 0 ; j < numplanes ; j++ ) {
|
||||||
|
@ -172,7 +174,10 @@ qboolean PM_SlideMove( qboolean gravity ) {
|
||||||
|
|
||||||
// try clipping the move to the plane
|
// try clipping the move to the plane
|
||||||
PM_ClipVelocity( clipVelocity, planes[j], clipVelocity, OVERCLIP );
|
PM_ClipVelocity( clipVelocity, planes[j], clipVelocity, OVERCLIP );
|
||||||
PM_ClipVelocity( endClipVelocity, planes[j], endClipVelocity, OVERCLIP );
|
|
||||||
|
if ( gravity ) {
|
||||||
|
PM_ClipVelocity( endClipVelocity, planes[j], endClipVelocity, OVERCLIP );
|
||||||
|
}
|
||||||
|
|
||||||
// see if it goes back into the first clip plane
|
// see if it goes back into the first clip plane
|
||||||
if ( DotProduct( clipVelocity, planes[i] ) >= 0 ) {
|
if ( DotProduct( clipVelocity, planes[i] ) >= 0 ) {
|
||||||
|
@ -185,10 +190,12 @@ qboolean PM_SlideMove( qboolean gravity ) {
|
||||||
d = DotProduct( dir, pm->ps->velocity );
|
d = DotProduct( dir, pm->ps->velocity );
|
||||||
VectorScale( dir, d, clipVelocity );
|
VectorScale( dir, d, clipVelocity );
|
||||||
|
|
||||||
CrossProduct (planes[i], planes[j], dir);
|
if ( gravity ) {
|
||||||
VectorNormalize( dir );
|
CrossProduct (planes[i], planes[j], dir);
|
||||||
d = DotProduct( dir, endVelocity );
|
VectorNormalize( dir );
|
||||||
VectorScale( dir, d, endClipVelocity );
|
d = DotProduct( dir, endVelocity );
|
||||||
|
VectorScale( dir, d, endClipVelocity );
|
||||||
|
}
|
||||||
|
|
||||||
// see if there is a third plane the the new move enters
|
// see if there is a third plane the the new move enters
|
||||||
for ( k = 0 ; k < numplanes ; k++ ) {
|
for ( k = 0 ; k < numplanes ; k++ ) {
|
||||||
|
@ -207,7 +214,11 @@ qboolean PM_SlideMove( qboolean gravity ) {
|
||||||
|
|
||||||
// if we have fixed all interactions, try another move
|
// if we have fixed all interactions, try another move
|
||||||
VectorCopy( clipVelocity, pm->ps->velocity );
|
VectorCopy( clipVelocity, pm->ps->velocity );
|
||||||
VectorCopy( endClipVelocity, endVelocity );
|
|
||||||
|
if ( gravity ) {
|
||||||
|
VectorCopy( endClipVelocity, endVelocity );
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue