From: divverent Date: Mon, 9 Feb 2015 08:46:35 +0000 (+0000) Subject: Fix dodgy use of plane.normal[3] as alias to plane.dist using a union. X-Git-Tag: xonotic-v0.8.1~29^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=895325dda6c0a128301d687e5094fd91b7c6a467;p=xonotic%2Fdarkplaces.git 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 --- 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;