Skip to content
Permalink
Browse files

Fix CG_Trace not handling NULL vectors

  • Loading branch information...
Kangz committed Sep 16, 2014
1 parent d41f6d7 commit 3cc52f47dae65bd3822a625b8001a8d5d1ad2562
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/gamelogic/cgame/cg_predict.cpp
@@ -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;

0 comments on commit 3cc52f4

Please sign in to comment.
You can’t perform that action at this time.