From a377c011febdb961837261ec4e5484d94467942c Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Wed, 28 Nov 2007 16:10:24 +0000 Subject: Set headnode number on edicts as game DLL expects. Avoid crash on NULL headnode. --- source/sv_world.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/sv_world.c') 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 ); } -- cgit v1.2.3