]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_cmds.c
q3bsp is still not working yet, but getting closer
[xonotic/darkplaces.git] / pr_cmds.c
index c0d6e440b56b301b47b3eb140fe586bfb22fffe9..faf7b1762fde70aed4bcd40ddfb6d1c00888d03b 100644 (file)
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -1297,7 +1297,7 @@ void PF_precache_model (void)
                Host_Error ("PF_Precache_*: Precache can only be done in spawn functions");
 
        s = G_STRING(OFS_PARM0);
-       if (sv.worldmodel->brushq1.ishlbsp && ((!s) || (!s[0])))
+       if (sv.worldmodel->brush.ishlbsp && ((!s) || (!s[0])))
                return;
        G_INT(OFS_RETURN) = G_INT(OFS_PARM0);
        PR_CheckEmptyString (s);
@@ -2542,8 +2542,6 @@ static msurface_t *getsurface(edict_t *ed, int surfnum)
        if (modelindex < 1 || modelindex >= MAX_MODELS)
                return NULL;
        model = sv.models[modelindex];
-       if (model->type != mod_brush)
-               return NULL;
        if (surfnum < 0 || surfnum >= model->brushq1.nummodelsurfaces)
                return NULL;
        return model->brushq1.surfaces + surfnum + model->brushq1.firstmodelsurface;
@@ -2623,7 +2621,7 @@ void PF_getsurfacenearpoint(void)
        if (modelindex < 1 || modelindex >= MAX_MODELS)
                return;
        model = sv.models[modelindex];
-       if (model->type != mod_brush)
+       if (!model->brushq1.numsurfaces)
                return;
 
        // FIXME: implement rotation/scaling