diff --git a/libs/models/alias/model_alias.c b/libs/models/alias/model_alias.c index 0f4b82f5d..0694b5514 100644 --- a/libs/models/alias/model_alias.c +++ b/libs/models/alias/model_alias.c @@ -300,9 +300,8 @@ Mod_LoadAliasModel (model_t *mod, void *buffer, cache_allocator_t allocator) total = end - start; mem = allocator (&mod->cache, total, loadname); - if (!mem) - return; // FIXME: shouldn't this call Hunk_FreeToLowMark too?!?! - memcpy (mem, pheader, total); + if (mem) + memcpy (mem, pheader, total); Hunk_FreeToLowMark (start); } diff --git a/libs/models/brush/model_brush.c b/libs/models/brush/model_brush.c index 3f48fb709..b61f54894 100644 --- a/libs/models/brush/model_brush.c +++ b/libs/models/brush/model_brush.c @@ -518,22 +518,17 @@ Mod_LoadFaces (lump_t *l) out->samples = loadmodel->lightdata + (i * mod_lightmap_bytes); // set the drawing flags flag - // FIXME: do this right?-) - if (!out->texinfo->texture) - continue; - if (!out->texinfo->texture->name) - continue; + if (!out->texinfo->texture || !out->texinfo->texture->name) + continue; // avoid crashing on null textures - if (!strncmp (out->texinfo->texture->name, "sky", 3)) // sky - { + if (!strncmp (out->texinfo->texture->name, "sky", 3)) { // sky out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED); if (gl_sky_divide && gl_sky_divide->int_val) GL_SubdivideSurface (out); continue; } - if (out->texinfo->texture->name[0] == '*') // turbulent - { + if (out->texinfo->texture->name[0] == '*') { // turbulent out->flags |= (SURF_DRAWTURB | SURF_DRAWTILED | SURF_LIGHTBOTHSIDES); @@ -918,8 +913,8 @@ Mod_LoadBrushModel (model_t *mod, void *buffer) mod->numleafs = bm->visleafs; - if (i < mod->numsubmodels - 1) { // duplicate the basic - // information + if (i < mod->numsubmodels - 1) { + // duplicate the basic information char name[10]; snprintf (name, sizeof (name), "*%i", i + 1);