From 161fa66d555ee5e22aa2dcfe635b5eac1b918503 Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 5 Nov 2021 17:44:00 +0000 Subject: [PATCH] Fix Q3BSP viewcontents issue. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6109 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/gl_q2bsp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index 6c9f1579..aec3f108 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -5204,6 +5204,7 @@ static int CM_PointCluster (model_t *mod, const vec3_t p, int *area) return CM_LeafCluster(mod, leaf); } +static int CM_PointContents (model_t *mod, const vec3_t p); static void CM_InfoForPoint (struct model_s *mod, vec3_t pos, int *area, int *cluster, unsigned int *contentbits) { int leaf = CM_PointLeafnum_r (mod, pos, 0); @@ -5211,6 +5212,10 @@ static void CM_InfoForPoint (struct model_s *mod, vec3_t pos, int *area, int *cl *area = CM_LeafArea(mod, leaf); *cluster = CM_LeafCluster(mod, leaf); *contentbits = CM_LeafContents(mod, leaf); + + //q3 needs to use brush contents (its leafs no longer need to strictly follow brushes) + if (mod->fromgame != fg_quake2) + *contentbits = CM_PointContents (mod, pos); } /*