summaryrefslogtreecommitdiff
path: root/source/sv_world.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-10-18 19:32:11 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-10-18 19:32:11 +0000
commitb7d3939f3f68617f80d74d0a2bf6ea34ddea1065 (patch)
tree65ddb08896c05b73b427267b0f22034839fd5420 /source/sv_world.c
parent24ea5c3d91c6aec73b8ef9633bf5a12146055c42 (diff)
Renamed `gtv.h' to `mvd_gtv.h'.
A few fixes here and there.
Diffstat (limited to 'source/sv_world.c')
-rw-r--r--source/sv_world.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/sv_world.c b/source/sv_world.c
index 3ad9748..2d35b94 100644
--- a/source/sv_world.c
+++ b/source/sv_world.c
@@ -125,7 +125,7 @@ void SV_ClearWorld( void ) {
===============
SV_LinkEdict
-General purpose routine shared by game DLL and MVD code.
+General purpose routine shared between game DLL and MVD code.
Links entity to PVS leafs.
===============
*/
@@ -435,14 +435,15 @@ static mnode_t *SV_HullForEntity( edict_t *ent ) {
mmodel_t *model;
if( ent->solid == SOLID_BSP ) {
+ int index = ent->s.modelindex - 1;
+
// explicit hulls in the BSP model
- if( ent->s.modelindex < 2 || ent->s.modelindex > sv.cm.cache->nummodels ) {
- Com_Error( ERR_DROP, "%s: inline model index %d out of range",
- __func__, ent->s.modelindex );
+ if( index <= 0 || index >= sv.cm.cache->nummodels ) {
+ Com_Error( ERR_DROP, "%s: inline model %d out of range",
+ __func__, index );
}
- model = &sv.cm.cache->models[ ent->s.modelindex - 1 ];
-
+ model = &sv.cm.cache->models[index];
return model->headnode;
}
@@ -479,7 +480,8 @@ int SV_PointContents (vec3_t p)
// might intersect, so do an exact clip
headnode = SV_HullForEntity (hit);
- c2 = CM_TransformedPointContents (p, headnode, hit->s.origin, hit->s.angles);
+ c2 = CM_TransformedPointContents (p, headnode,
+ hit->s.origin, hit->s.angles);
contents |= c2;
}