FS_StripExtension(inname, basename, sizeof(basename));
mod = Mod_ForName(inname, false, true, inname[0] == '*' ? cl.model_name[1] : NULL);
+ if (!mod)
+ {
+ Con_Print("No such model\n");
+ return;
+ }
if (mod->brush.submodel)
{
// if we're decompiling a submodel, be sure to give it a proper name based on its parent
dpsnprintf(basename, sizeof(basename), "%s/%s", outname, mod->name);
outname[0] = 0;
}
- if (!mod)
- {
- Con_Print("No such model\n");
- return;
- }
if (!mod->surfmesh.num_triangles)
{
Con_Print("Empty model (or sprite)\n");