From 895325dda6c0a128301d687e5094fd91b7c6a467 Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 9 Feb 2015 08:46:35 +0000 Subject: [PATCH] Fix dodgy use of plane.normal[3] as alias to plane.dist using a union. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12159 d7cf8633-e32d-0410-b094-e92efae38249 --- collision.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/collision.h b/collision.h index f4f47617..70fbd485 100644 --- a/collision.h +++ b/collision.h @@ -2,10 +2,14 @@ #ifndef COLLISION_H #define COLLISION_H -typedef struct plane_s +typedef union plane_s { - vec3_t normal; - float dist; + struct + { + vec3_t normal; + vec_t dist; + }; + vec4_t dist_and_normal; } plane_t; @@ -76,8 +80,15 @@ typedef struct colplanef_s { const struct texture_s *texture; int q3surfaceflags; - vec3_t normal; - vec_t dist; + union + { + struct + { + vec3_t normal; + vec_t dist; + }; + vec4_t normal_and_dist; + }; } colplanef_t; -- 2.39.2