2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00

Merge pull request #519 from theAsmodai/master

Use CONTENTS_EMPTY const (Fix #517)
This commit is contained in:
theAsmodai 2017-08-24 13:22:29 +02:00 committed by GitHub
commit 4246a44557

View File

@ -96,7 +96,7 @@ void SV_InitBoxHull(void)
{ {
int side = i & 1; int side = i & 1;
box_clipnodes[i].planenum = i; box_clipnodes[i].planenum = i;
box_clipnodes[i].children[side] = -1; box_clipnodes[i].children[side] = CONTENTS_EMPTY;
box_clipnodes[i].children[side ^ 1] = (i != 5) ? i + 1 : CONTENTS_SOLID; box_clipnodes[i].children[side ^ 1] = (i != 5) ? i + 1 : CONTENTS_SOLID;
box_planes[i].type = i >> 1; box_planes[i].type = i >> 1;
beam_planes[i].type = 5; beam_planes[i].type = 5;
@ -683,14 +683,14 @@ int SV_LinkContents(areanode_t *node, const vec_t *pos)
localPosition[0] = pos[0] - offset[0]; localPosition[0] = pos[0] - offset[0];
localPosition[1] = pos[1] - offset[1]; localPosition[1] = pos[1] - offset[1];
localPosition[2] = pos[2] - offset[2]; localPosition[2] = pos[2] - offset[2];
if (SV_HullPointContents(hull, hull->firstclipnode, localPosition) != -1) if (SV_HullPointContents(hull, hull->firstclipnode, localPosition) != CONTENTS_EMPTY)
return contents; return contents;
} }
} }
} }
if (node->axis == -1) if (node->axis == -1)
return -1; return CONTENTS_EMPTY;
#ifndef REHLDS_OPT_PEDANTIC #ifndef REHLDS_OPT_PEDANTIC
if (pos[node->axis] > node->dist) if (pos[node->axis] > node->dist)
@ -715,7 +715,7 @@ int SV_LinkContents(areanode_t *node, const vec_t *pos)
#endif // REHLDS_OPT_PEDANTIC #endif // REHLDS_OPT_PEDANTIC
} }
return -1; return CONTENTS_EMPTY;
} }
int SV_PointContents(const vec_t *p) int SV_PointContents(const vec_t *p)
@ -735,7 +735,7 @@ int SV_PointContents(const vec_t *p)
} }
entityContents = SV_LinkContents(&sv_areanodes[0], p); entityContents = SV_LinkContents(&sv_areanodes[0], p);
return (entityContents != -1) ? entityContents : cont; return (entityContents != CONTENTS_EMPTY) ? entityContents : cont;
} }
edict_t *SV_TestEntityPosition(edict_t *ent) edict_t *SV_TestEntityPosition(edict_t *ent)