]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
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 85a53826222b91bb7c7d8de5ec696f6f2f817149..3d63db31c71ff951b2f9050078e0570bd7340a5c 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)
                {