fixed bug that used bmodel collision geometry on non-SOLID_BSP entities (thanks to...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 3 Jun 2003 05:18:04 +0000 (05:18 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 3 Jun 2003 05:18:04 +0000 (05:18 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3063 d7cf8633-e32d-0410-b094-e92efae38249

world.c

diff --git a/world.c b/world.c
index 85a5382..3d63db3 100644 (file)
--- a/world.c
+++ b/world.c
@@ -453,17 +453,17 @@ trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t max
 {
        int i;
        trace_t trace;
-       model_t *model;
-
-       i = ent->v->modelindex;
-       if ((unsigned int) i >= MAX_MODELS)
-               Host_Error("SV_ClipMoveToEntity: invalid modelindex\n");
-       model = sv.models[i];
-       if (i != 0 && model == NULL)
-               Host_Error("SV_ClipMoveToEntity: invalid modelindex\n");
+       model_t *model = NULL;
 
        if ((int) ent->v->solid == SOLID_BSP)
        {
+               i = ent->v->modelindex;
+               if ((unsigned int) i >= MAX_MODELS)
+                       Host_Error("SV_ClipMoveToEntity: invalid modelindex\n");
+               model = sv.models[i];
+               if (i != 0 && model == NULL)
+                       Host_Error("SV_ClipMoveToEntity: invalid modelindex\n");
+
                Mod_CheckLoaded(model);
                if (model->type != mod_brush)
                {