summaryrefslogtreecommitdiff
path: root/source/sv_world.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-11-28 16:10:24 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-11-28 16:10:24 +0000
commita377c011febdb961837261ec4e5484d94467942c (patch)
tree3e1771079d78db5181510d6cdf65a16a7ceaf369 /source/sv_world.c
parentd67917510d5795c9ff8364ceb8d6389369809f54 (diff)
Set headnode number on edicts as game DLL expects.
Avoid crash on NULL headnode.
Diffstat (limited to 'source/sv_world.c')
-rw-r--r--source/sv_world.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/sv_world.c b/source/sv_world.c
index f802abc..9f5b71d 100644
--- a/source/sv_world.c
+++ b/source/sv_world.c
@@ -209,7 +209,7 @@ void SV_LinkEdict( cm_t *cm, edict_t *ent ) {
if (num_leafs >= MAX_TOTAL_ENT_LEAFS)
{ // assume we missed some leafs, and mark by headnode
ent->num_clusters = -1;
- ent->headnode = topnode - cm->cache->nodes;
+ ent->headnode = CM_NumNode( cm, topnode );
}
else
{
@@ -226,7 +226,7 @@ void SV_LinkEdict( cm_t *cm, edict_t *ent ) {
if (ent->num_clusters == MAX_ENT_CLUSTERS)
{ // assume we missed some leafs, and mark by headnode
ent->num_clusters = -1;
- ent->headnode = topnode - cm->cache->nodes;
+ ent->headnode = CM_NumNode( cm, topnode );
break;
}
@@ -409,7 +409,7 @@ static cnode_t *SV_HullForEntity( edict_t *ent ) {
if( ent->solid == SOLID_BSP ) {
// explicit hulls in the BSP model
- if( ent->s.modelindex < 1 || ent->s.modelindex > sv.cm.cache->numcmodels ) {
+ if( ent->s.modelindex < 2 || ent->s.modelindex > sv.cm.cache->numcmodels ) {
Com_Error( ERR_DROP, "SV_HullForEntity: inline model index %d out of range", ent->s.modelindex );
}