Change back to storing the leafnum.

Still unlimited, of course :)
This commit is contained in:
Bill Currie 2010-12-09 15:30:08 +09:00
parent 64be913350
commit bc91faf51e
6 changed files with 7 additions and 10 deletions

View file

@ -212,7 +212,7 @@ extern progs_t sv_pr_state;
typedef struct edict_leaf_s {
struct edict_leaf_s *next;
struct mleaf_s *leaf;
unsigned leafnum;
} edict_leaf_t;
typedef struct sv_data_s {

View file

@ -465,8 +465,7 @@ SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg)
continue;
for (el = SVdata (ent)->leafs; el; el = el->next) {
unsigned leafnum = el->leaf - sv.worldmodel->leafs - 1;
if (pvs[leafnum >> 3] & (1 << (leafnum & 7)))
if (pvs[el->leafnum >> 3] & (1 << (el->leafnum & 7)))
break;
}

View file

@ -423,7 +423,7 @@ SV_FindTouchedLeafs (edict_t *ent, mnode_t *node)
leaf = (mleaf_t *) node;
edict_leaf = alloc_edict_leaf ();
edict_leaf->leaf = leaf;
edict_leaf->leafnum = leaf - sv.worldmodel->leafs - 1;
edict_leaf->next = SVdata (ent)->leafs;
SVdata (ent)->leafs = edict_leaf;
return;

View file

@ -199,7 +199,7 @@ extern progs_t sv_pr_state;
typedef struct edict_leaf_s {
struct edict_leaf_s *next;
struct mleaf_s *leaf;
unsigned leafnum;
} edict_leaf_t;
typedef struct sv_data_s {

View file

@ -616,8 +616,7 @@ SV_WritePlayersToClient (delta_t *delta, byte *pvs, sizebuf_t *msg)
if (pvs) {
// ignore if not touching a PV leaf
for (el = SVdata (ent)->leafs; el; el = el->next) {
unsigned leafnum = el->leaf - sv.worldmodel->leafs - 1;
if (pvs[leafnum >> 3] & (1 << (leafnum & 7)))
if (pvs[el->leafnum >> 3] & (1 << (el->leafnum & 7)))
break;
}
if (!el)
@ -805,8 +804,7 @@ SV_WriteEntitiesToClient (delta_t *delta, sizebuf_t *msg)
if (pvs) {
// ignore if not touching a PV leaf
for (el = SVdata (ent)->leafs; el; el = el->next) {
unsigned leafnum = el->leaf - sv.worldmodel->leafs - 1;
if (pvs[leafnum >> 3] & (1 << (leafnum & 7)))
if (pvs[el->leafnum >> 3] & (1 << (el->leafnum & 7)))
break;
}
if (!el)

View file

@ -423,7 +423,7 @@ SV_FindTouchedLeafs (edict_t *ent, mnode_t *node)
leaf = (mleaf_t *) node;
edict_leaf = alloc_edict_leaf ();
edict_leaf->leaf = leaf;
edict_leaf->leafnum = leaf - sv.worldmodel->leafs - 1;
edict_leaf->next = SVdata (ent)->leafs;
SVdata (ent)->leafs = edict_leaf;
return;