Skip to content

Commit

Permalink
Fix CG_Trace not handling NULL vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kangz committed Sep 16, 2014
1 parent d41f6d7 commit 3cc52f4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/gamelogic/cgame/cg_predict.cpp
Expand Up @@ -250,9 +250,15 @@ void CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec
{
trace_t t;

vec3_t mymins, mymaxs;
VectorCopy(mins, mymins);
VectorCopy(maxs, mymaxs);
vec3_t mymins = {0.0f, 0.0f, 0.0f};
vec3_t mymaxs = {0.0f, 0.0f, 0.0f};

if (mins) {
VectorCopy(mins, mymins);
}
if (maxs) {
VectorCopy(maxs, mymaxs);
}

trap_CM_BoxTrace( &t, start, end, mymins, mymaxs, 0, mask, skipmask );
t.entityNum = t.fraction != 1.0 ? ENTITYNUM_WORLD : ENTITYNUM_NONE;
Expand Down

0 comments on commit 3cc52f4

Please sign in to comment.