//Con_Printf("dlight %i : %f %f %f : %f %f %f\n", i, org[0], org[1], org[2], red * radius, green * radius, blue * radius);
memset (dl, 0, sizeof(*dl));
dl->ent = ent;
- cl.worldmodel->FindNonSolidLocation(cl.worldmodel, org, dl->origin, 6);
+ if (cl.worldmodel)
+ cl.worldmodel->FindNonSolidLocation(cl.worldmodel, org, dl->origin, 6);
//VectorCopy(org, dl->origin);
dl->radius = radius;
dl->color[0] = red;
char *pointfile = NULL, *pointfilepos, *t, tchar;
char name[MAX_OSPATH];
+ if (!cl.worldmodel)
+ return;
+
FS_StripExtension(cl.worldmodel->name, name);
strcat(name, ".pts");
#if WORKINGLQUAKE
mleaf_t *viewleaf;
Matrix4x4_Transform(&ent->inversematrix, r_origin, modelorg);
- viewleaf = ent->model->PointInLeaf(ent->model, modelorg);
+ viewleaf = ent->model ? ent->model->PointInLeaf(ent->model, modelorg) : NULL;
R_PVSUpdate(ent, viewleaf);
if (!viewleaf)
animscene_t *scene;
frameblend_t *blend;
- if (!r->model)
+ if (!r->model || !r->model->type)
return;
blend = r->frameblend;
int row;
float low[3], high[3], dist, maxdist;
- if (!r_dynamic.integer)
+ if (!r_dynamic.integer || !ent->model)
return;
Matrix4x4_Transform(&ent->inversematrix, rd->origin, lightorigin);
float f;
rdlight_t *rd;
mlight_t *sl;
- if (leaf == NULL)
+ if (leaf == NULL && cl.worldmodel != NULL)
leaf = cl.worldmodel->PointInLeaf(cl.worldmodel, p);
if (!leaf || leaf->contents == CONTENTS_SOLID || r_fullbright.integer || !cl.worldmodel->lightdata)
{
ambient4f[3] = colora;
return false;
}
- leaf = cl.worldmodel->PointInLeaf(cl.worldmodel, ent->origin);
+ leaf = cl.worldmodel ? cl.worldmodel->PointInLeaf(cl.worldmodel, ent->origin) : NULL;
if (!leaf || leaf->contents == CONTENTS_SOLID || !cl.worldmodel->lightdata)
ambient4f[0] = ambient4f[1] = ambient4f[2] = 1;
else