mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
collision: add additional checks
This commit is contained in:
parent
59d6766e90
commit
6701ad8cc5
1 changed files with 11 additions and 1 deletions
|
@ -2231,6 +2231,11 @@ CM_LeafContents(int leafnum)
|
||||||
int
|
int
|
||||||
CM_LeafCluster(int leafnum)
|
CM_LeafCluster(int leafnum)
|
||||||
{
|
{
|
||||||
|
if (!cmod->map_leafs)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ((leafnum < 0) || (leafnum >= (cmod->numleafs + EXTRA_LUMP_LEAFS)))
|
if ((leafnum < 0) || (leafnum >= (cmod->numleafs + EXTRA_LUMP_LEAFS)))
|
||||||
{
|
{
|
||||||
Com_Error(ERR_DROP, "%s: bad number", __func__);
|
Com_Error(ERR_DROP, "%s: bad number", __func__);
|
||||||
|
@ -2242,6 +2247,11 @@ CM_LeafCluster(int leafnum)
|
||||||
int
|
int
|
||||||
CM_LeafArea(int leafnum)
|
CM_LeafArea(int leafnum)
|
||||||
{
|
{
|
||||||
|
if (!cmod->map_leafs)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ((leafnum < 0) || (leafnum >= (cmod->numleafs + EXTRA_LUMP_LEAFS)))
|
if ((leafnum < 0) || (leafnum >= (cmod->numleafs + EXTRA_LUMP_LEAFS)))
|
||||||
{
|
{
|
||||||
Com_Error(ERR_DROP, "%s: bad number", __func__);
|
Com_Error(ERR_DROP, "%s: bad number", __func__);
|
||||||
|
@ -2333,7 +2343,7 @@ CM_ClusterPVS(int cluster)
|
||||||
byte *
|
byte *
|
||||||
CM_ClusterPHS(int cluster)
|
CM_ClusterPHS(int cluster)
|
||||||
{
|
{
|
||||||
if (cluster == -1)
|
if (cluster == -1 || !cmod->map_vis)
|
||||||
{
|
{
|
||||||
memset(phsrow, 0, (cmod->numclusters + 7) >> 3);
|
memset(phsrow, 0, (cmod->numclusters + 7) >> 3);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue