collision: fix crash without vis info

This commit is contained in:
Denis Pauk 2024-04-08 23:07:01 +03:00
parent 30861e07ef
commit 1e935a5879

View file

@ -2185,6 +2185,12 @@ CM_LoadCachedMap(const char *name, model_t *mod)
Mod_LoadVisibility(mod->name, &mod->map_vis, &mod->numvisibility,
cmod_base, &header.lumps[LUMP_VISIBILITY]);
if (!mod->map_vis)
{
Com_Error(ERR_DROP, "%s: Map %s has visual clusters.",
__func__, name);
}
if (mod->numclusters != mod->map_vis->numclusters)
{
Com_Error(ERR_DROP, "%s: Map %s has incorrect number of clusters %d != %d",