diff --git a/src/common/collision.c b/src/common/collision.c index 285a0df1..efbac7a4 100644 --- a/src/common/collision.c +++ b/src/common/collision.c @@ -2231,6 +2231,11 @@ CM_LeafContents(int leafnum) int CM_LeafCluster(int leafnum) { + if (!cmod->map_leafs) + { + return 0; + } + if ((leafnum < 0) || (leafnum >= (cmod->numleafs + EXTRA_LUMP_LEAFS))) { Com_Error(ERR_DROP, "%s: bad number", __func__); @@ -2242,6 +2247,11 @@ CM_LeafCluster(int leafnum) int CM_LeafArea(int leafnum) { + if (!cmod->map_leafs) + { + return 0; + } + if ((leafnum < 0) || (leafnum >= (cmod->numleafs + EXTRA_LUMP_LEAFS))) { Com_Error(ERR_DROP, "%s: bad number", __func__); @@ -2333,7 +2343,7 @@ CM_ClusterPVS(int cluster) byte * CM_ClusterPHS(int cluster) { - if (cluster == -1) + if (cluster == -1 || !cmod->map_vis) { memset(phsrow, 0, (cmod->numclusters + 7) >> 3); }